Closed swordligit closed 6 months ago
I am lucky, https://github.com/ARM-software/CMSIS-FreeRTOS/pull/86 this commit fix my problem. Thanks a lot.
I'm glad your problem has been fixed already! Many thanks for taking the time to create the report anyway, that's the fastest way to get the issues solved!
Hi, Here is an example, there are two task, phaseA and clock: phaseA:
thread clock:
Here the task clock will set flags 0x1000, 0x0100 before set 0x0003,(which task phaseA is waiting). after set flag 0x0003, the phaseA will wake up and the get the flags.
The problem is after phaseA take the flags 0x0003, and then it will call osThreadFlagsWait again, but this time phaseA will going into block state, even there are 0x1000 | 0x0100 flags in its thread flags. The RTX5's implementation will just return the left flags(here is 0x1000|0x0100 = 0x1100) and will not go into block state. In the implementation of osThreadFlagsWait :
The cause maybe after xTaskNotifyWait return, it will set the
Then next time when call xTaskNotifyWait again, it first judge the ucNotifyState, if it is not taskNOTIFICATION_RECEIVED, it will go into block state:
But these are flags still in the task phaseA. Here is the test code:
and the log:
Br, Yingchun