Zephyr vs FreeRTOS drivers and interrupt

Anders Dam Kofoed <adk@...>

Hi all,

I cannot seem to find any info on this question, so I thought I'd ask here.

My question is this: When a driver (eg. SPI or UART)  is invoked through FreeRTOS, it is using the vendor HAL (or registers directly). Then there are two options for calling it: 1) busy waiting and 2) busy-waiting. If the FreeRTOS task busy-waits and FreeRTOS has a preemptive scheduler, then my question is this: FreeRTOS does not have knowledge of the busy-waiting, hence the task gets allocated a timeslot (for doing busy-waiting). Is this correct?

Now in Zephyr, I can see that when the driver is called, Zephyr keeps track of the calling task (which is then suspended), and in the drivers interrupt routine it puts the calling thread into the run-queue, ready to proceed. This way no cycles are waisted.

Anders Dam Kofoed

Join {devel@lists.zephyrproject.org to automatically receive all group messages.