Hello,
In an nRF52840, NCS2.7.0 application (based on BT NUS shell) I need to address the following case:
- UART Interrupt handler monitors incoming bytes
- A working thread (UART message parser & handler) is blocked on a sync object until a full message is received
- Once the interrupt handler recognizes the end-of-UART-messgae condition, it asserts the sync object
- The thread gets unblocked and handles the received message.
The problem I'm facing is a very looong (>20ms !) latency from the time the interrupt asserted the sync object until the thread is unblocked.
I tried:
- Using events for synchronization (k_event_post/k_event_wait)
- Using Semaphore (k_sem_give/k_sem_take)
- Changing the thread priority between priority 7 & priority 1
Nothing seems to improve the poor real-time response to a reasonable latency.
I have past experience with freertos and I've never experienced such long latencies. I assume I'm missing something here.
- Is there a recommended 'light' sync object that can mitigate that?
- Will using a workqueue yield a better realtime behavior?
- Any Kconfig parameter I should be aware of?
Thanks for any advice