[RTOS] The Night Before Scheduling: Analysis of Interrupt Failure in FreeRTOS

[RTOS] The Night Before Scheduling: Analysis of Interrupt Failure in FreeRTOS

Phenomenon Before FreeRTOS starts scheduling with <span>vTaskStartScheduler()</span>, if FreeRTOS APIs (such as creating semaphores) are called, it will lead to interrupts managed by FreeRTOS being disabled until scheduling begins. Source Code Analysis In the FreeRTOS API, there are critical sections like this: // Common code snippet in FreeRTOS source: entering and exiting critical sections BaseType_t … Read more

Understanding Critical Sections in FreeRTOS

Understanding Critical Sections in FreeRTOS

When it comes to critical sections in FreeRTOS, there are several questions that need to be addressed:1. How is the protection of critical sections implemented?2. What is the relationship with interrupt priority?3. Will masking interrupts affect the operating system’s tick timing and cause a temporary loss of the system clock?With these questions in mind, let’s … Read more