Hi, I use freeRTOS kernel version 10.0.1 with IAR 7.2 on Cortex M4.
My test case just reviece data from uart irq and sent it to a queue for process in another task named “UartDataProcess” run at Priority 6,
Everything works fine when I run the system to transmit data at the beginning. After transmitting 10+ hours, somehow the task “UartDataProcess” will get stuck at ready state and never jump out. In this case, other Tasks, including IDLE Tasks, are normally scheduled
and the Task will be resume if i modify the bit of Priority 6 on “uxTopReadyPriority”, after that everything run is OK.
It is looks like topic of [Task stuck in ready state on cortex-M33] very mush.
But no irq with Priority 0
Below is my Macro:
configUSE_PREEMPTION 1
configUSE_TIME_SLICING 1
configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define __NVIC_PRIO_BITS 3U #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
Does anyone have any idea why the stuck issue happens?
why do you claim the critical section? Try without it. When the system is in the problematic state, do you still get sys tick interrupts? I suspect that your task blocks while it still holds the critical section which will mayexplain the behavior you see.
sys tick interrupts is OK, anyother task scheduled is OK except this one,
when i modify the bit of Priority 6 on “uxTopReadyPriority”, this task will resume
Thanks for you feedback,
and i check these in the printf as below:
configMAX_SYSCALL_INTERRUPT_PRIORITY = 160
configKERNEL_INTERRUPT_PRIORITY = 480
configPRIO_BITS = 3
application stack overflow. Try running the task with a larger stack.
there may be a race condition where your queue wait timeout expires just before the queue is refilled. check your log whether there is an entry that indicates timeout short before communication ceases.
Other than that, the configuration looks ok, but almost all of your task code is calling non native functions that may be subject to all kinds of problems.
Note that the observation you make about the bit you can manipulate to get the task back to running is just a symptom. Concurrency problems may manifest themselves in literally a bazillion of ways.