-
Couldn't load subscription status.
- Fork 1.4k
Description
Describe the bug
Running on the SMP system, the system stops scheduling, and an assertion is triggered at configASSERT( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) in the code of the prvCheckForRunStateChange function.
In the vTaskSuspendAll function, the portSET_INTERRUPT_MASK() macro is used to disable interrupts before calling prvCheckForRunStateChange. However, the prvCheckForRunStateChange function code uses the portENABLE_INTERRUPTS() macro to temporarily enable task switching, which results in task switching not actually being enabled. After calling portENABLE_INTERRUPTS(), the interrupts used for scheduling remain masked.
Target
- Development board: [user-defined]
- Instruction Set Architecture: [ARM_CR82]
- IDE and version: [IAR 9.20]
To Reproduce
- Use multi-task with xSemaphoreXXX function on multi-core system.
- Frequent calls to the
vTaskSuspendAllfunction - Frequent calls to the
prvYieldCore( xCoreID )macro
Additional context
It might be appropriate to use the portDISABLE_INTERRUPTS() macro instead of the portSET_INTERRUPT_MASK() macro in the vTaskSuspendAll function.