I am using FreeRTOS 9 with STM32L152. I use implementation from CUBEMX. I have 2 questions:
When I run my code, sometimes after for example 1 hour of running my code, the watchdog in my code resets the MCU. When I debuged it I found out, that the TASK B is in some weird state. FreeRTOS Task list in True Studio shows that the the state of Task B is DELAYED - waht does it mean? I did not found this state any where - there are written only states like Blocked, Running,… The Task become in running state but it takes some time.
Sometimes I can see in Percepio TraceAlyzer, that some task has prepared a new message in queue, but the FreeRTOS still persist in Idle (in my case tickless - MCU is in STOP mode). Why the FreeRTOS does not run the corresponding task where is xQueueReceive(QueueCoreHandle, &ReceiveData, portMAX_DELAY);
See the picture in attachement.
When I run my code, sometimes after for example 1 hour of running my
code, the watchdog in my code resets the MCU. When I debuged it I found
out, that the TASK B is in some weird state. FreeRTOS Task list in True
Studio shows that the the state of Task B is DELAYED - waht does it
mean? I did not found this state any where - there are written only
states like Blocked, Running,… The Task become in running state but it
takes some time.
Not familiar with that plug-in, but I’m going to guess they are using
Delayed for what we call Blocked.
Sometimes I can see in Percepio TraceAlyzer, that some task has
prepared a new message in queue, but the FreeRTOS still persist in Idle
(in my case tickless - MCU is in STOP mode). Why the FreeRTOS does not
run the corresponding task where is|xQueueReceive(QueueCoreHandle,
&ReceiveData, portMAX_DELAY);|
See the picture in attachement.
Do you use the ‘xHigherPriorityTaskWoken’ parameter in the function used
to write to the queue from the ISR? If not then the task switch won’t
happen until the next tick.
They use Blocked too - it means the Delayed is something different
Maybe they differentiate between a task that is blocked on an event
(like waiting for something from a queue) and a task that has called
either vTaskDelay() or vTaskDelayUntil()? Just guessing though - is
there any documentation for the plug-in?
I use it like this:
Code looks fine. Can you step into the function to see why it doesn’t
switch?
Now I can not replicate the state. But I can reliably replicate this similar problem (see a picture):
TaskRF ends up with command vTaskDelay(2); And even if TaskRF has a new message in the Queue, the Task is stopped and Idle becomes running. There are no Any semaphores, or mutexes…
The code can run in this area many times, but after some time it ends there.
Do you have any idea why this happen?