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

Observer under FreeRTOS: Events stop coming after a few minutes.

Observer under FreeRTOS: Events stop coming after a few minutes.

Hi there,

I am using the nRF52832 as simple observer running under FreeRTOS on a custom board. The built is based on the SDK HRM peripheral example. I have stripped down my code so that only the task left is the one in which the SD runs. I have a handler for BLE_GAP_EVT_ADV_REPORT events installed. Nothing else is running (no UART or any other peripheral).

The SD stops calling my handler after a few minutes (completely random) if the runtime of the handler (artificial busy-loop) is longer than about 300us which, I guess, is roughly the minimum distance between two advertising reports minus caller overhead. The SD throws no hardfault or any other error, the BLE events just stop coming in. FreeRTOS continues running normally. With the handler runtime below 200us, everything is fine. Strangely, runtimes >>300us (e.g. 10ms) do not accelerate the occurrence of the error.

Any idea where this might come from?

Thanks.

Parents Reply
  • Not sure. As I said, I have stripped down the project to only one task (the one running the SD), so there cannot be a deadlock between tasks.

    My current workaround is to communicate the event to a lower-priority task using a binary semaphore and treat the event there. This takes only ~20us in the event handler and the problem goes away.

    However this does not satisfy me as I think there is still something wrong at the base.

Children
Related