This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Will spending too much time in Interrupt level 2 and 3 cause disconnects.

We have an application running on our devices that are using ble_nus to communicate with a base station.

The use case is approximately something like this:

On button presses small data packages (less than 5 bytes) are send via ble_nus.

The rest of the time is spend doing other tasks based on interrupts from external sensors. Some of these tasks could spend seconds in interrupt levels 2-3.

The problem that occurs is that the connection to the base station is often lost with an error with reason 0x8 when the device is busy handling the other tasks.

As far as we can read from the documentation the interrupt levels 0,1 and 4 are reserved by the softdevice, and level 4 isn't time critical so we assume that it shouldn't cause disconnects to block it. https://www.nordicsemi.com/DocLib/Content/SoftDevice_Spec/s132/latest/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd

(Bonus question: That page in the documentation doesn't say anything about that level 5 is reserved, but in most sdk_config.h files you can find the text: "// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice", so is it actually reserved too? We aren't using interrupt level 5 anyways.

We are using: 

s132_nrf52_6.1.0_softdevice with nRF5_SDK_15.2.0_9412b96 on a nRF52832 on a custom board.

The base station is in this case simplified to a PCA10040 running an almost not modified version of the ble_app_uart_c example from the SDK.

Parents Reply Children
No Data
Related