GPIO base addresses different for S (sense) and NS (no sense)

The last years I have developed a lot software (low level) for the nRF52840. I like this MCU very much, especially the SHORTS-Registers and EasyDMA are powerful for real short latency time with the peripherals. 

I do not like the RTOS. I have (a lot) Arduino Nano BLE 33 Sense with MbedOS, trying to bypass the OS wherever possible. I just finished a project for audio analysis with a lot of digital filters (mixed low pass and band pass) running in the background on the interrupt of the PDM-periphery (20 kHz scanning frequency). There is some jitter which may be caused by the OS.

Now I want to switch to the Seeed XIAO nRF54L15 Sense for 2 reasons: 1. the higher speed which would allow to double my number of filters and 2. the possibility to avoid the RTOS (https://github.com/lolren/nrf54-arduino-core).

I started the evaluation with the GPIOs (I use them with direct register access to measure the timing of interrupt handlers) and I have problems to understand the documentation. While it is very clear for the 52840, there are two base addresses for the ports of the 54L15, S for sense and NS for no sense. Why? If i read the description correct, this selection is done via the CNF-Registers. And which is the correct base address? (I will use NS, but that points to 0x4....... and from 52840 I expect 0x5.......).

Surely it is easy for the Nordic experts to explain these two base addresses for the GPIO ports. Thanks in advance ...

Update: Though the AI answer is really helpful, I will post this question anyway. Because otherwise this forum does not make any sense, it will be empty if the AI has learned enough. Hopefully the AI answer is published here.

  • S = Secure (a pain), NS = Non-Secure (simpler)

    Unless you require Secure mode, I would suggest just using Non-Secure (identical to the nRF52840/nRF52833), much easier to develop with. Nordic will provide more details I expect.

  • Hello,

    What   says here is correct. 

    There is a split. If you want your application to be really secure, you can split it into a secure and a non-secure partition. One analogy is that if you are to control an elevator, the secure part would be able to control the motor speed of the lift, and the non-secure part would handle button presses etc. If your application is compromized, the attacker may be able to simulate button presses in the elevator, open and close the doors, and send it to whatever floor they like, but they will not be able to crash the elevator down into the basement, because the motor control is out of reach. 

    So for simple applications where this is not a concern, you can use the S(secure). This might sound contraintuitive, because it has "less security", but by default it is the secure domain has access to all resources (memory, peripherals, etc.), while the non-secure domain only has access to whatever resources you specifically grant it.

    I imagine that since you want to skip the RTOS alltogether, you also don't want to set up a secure and non-secure partition/domain without the RTOS, so you can just stick to the "S" registers wherever they are listed as S both NS.

    Best regards,

    Edvin

  •  

    Yes, the AI explained it accordingly. But your meaning "a pain" vs. "simple" even more meets my sense.

    My mistake was to skip the security stuff in the product description and directly started with comparing the GPIO registers. Just before the two base addresses with S and NS, there is an explanation of Sense an No Sense. That was my pit.

    Thank you very much for your answer.

     

    Wow, your answer is even better than that of the AI. Very, very helpful. Because I use micro-controllers on a very low (physical) level, there is no interface to compromise my application. (Such issues may occur in some upper levels, where I use tools like Raspberry Pi).

    So it was a good idea to post my question anyway though the AI answer encouraged me to do not.

    I will use "S" addresses (which are physical near to the addresses of 52840).

    Thank you very much for opening the curtain.

    Best regards

    Robert

  • Careful: You don't typically care or use register addresses directly in application code.

    App code is supposed to use device tree references for things like GPIO pins. Those handle addresses and other stuff for you under the hood.

    And even if you want to use direct register access for some reason, there are compiler macros that auto select the correct peripherial address for you. For the GPIOs it should be something simple like NRF_P0 and NRF_P1 unless this was changed for the NRF54x chips.

    Another bad news: Due to how interrupts (and especially BTLE) work on these chips, interrupt timing has a very high variance. If you wanted  precise signals, you will need to use hardware  signal generation.

Related