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
  • Norbert said:
    So the probability of getting two reports coming in very close together is pretty high.

     This should not be a problem for the SD and I do not think is the reason for what you see.

    I think that you are seeing a deadlock somewhere in one of your threads. Hard to say where and why, but if there are any conditions where you are waiting for some flags set in another thread, then make sure that you have scoped out a possibility of having a deadlock there since these checks are not normally atomic.

Children
Related