Hi,
I noticed IRQs cannot preempt each other. Wondering how RTOS (e.g. FreeRTOS) accomplishes prioritized scheduled tasks on this chip?
We do not want to use an RTOS, looking for a way to do this without RTOS.
Thanks,
Peman
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I noticed IRQs cannot preempt each other. Wondering how RTOS (e.g. FreeRTOS) accomplishes prioritized scheduled tasks on this chip?
We do not want to use an RTOS, looking for a way to do this without RTOS.
Thanks,
Peman
Peman,
Consider a simple OS such as a basic task scheduler, which has a series of tasks performed in order with a fixes task-switching frequency (tick). Each task corresponds to a specific function, e.g. CAN communication, ADC conversions, etc. The CPU reads a status flag in the RAM which instructs it to either execute a task or not. This status flag is then set or cleared in an interrupt service routine specific for that task. e.g. a CAN RX interrupt will only set the flag to allow the CAN communication task to read the received messages. This way the interrupt service routines are kept really short, with all processing happening in the assigned tasks.
Hope this helps. For more information on task prioritization in FreeRTOS refer to https://www.freertos.org/RTOS-task-priority.html
Regards, Sunil