xQueueReceive(QueueCoreHandle, &ReceiveData, portMAX_DELAY);
See the picture in attachement.
Thank you very much. Jan.
State task Delayed
Hi,
I am using FreeRTOS 9 with STM32L152. I use implementation from CUBEMX. I have 2 questions:
1) 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.
2) 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
State task Delayed
1) 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.
2) 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.
State task Delayed
Hi,
thank you for fast reply!
1) They use Blocked too – it means the Delayed is something different
2) I use it like this:
~~~
signed portBASE_TYPE xHigherPriorityTaskWoken;
xHigherPriorityTaskWoken=pdFALSE;
LL_TIM_DisableCounter(TIM6);
/* Watchdog checking */
SendData.Address=ADDR_CORE_TIME_TO_CHECK_WATCHDOG;
if (xQueueSendToFrontFromISR(QueueCoreHandle, &SendData,&xHigherPriorityTaskWoken)!=pdPASS)
{
SendErrorCode_AND_Reset(0,0);
}
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
~~~
State task Delayed
1) They use Blocked too – it means the Delayed is something differentMaybe 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?
2) I use it like this:Code looks fine. Can you step into the function to see why it doesn’t switch?
State task Delayed
Hi Richard,
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?
Best Regards, Jan.
State task Delayed
Well a call to vTaskDelay(2) means to block the calling task for 2 timer ticks, doesn’t matter if there is some other queue with data.
State task Delayed
Sure, I understand it. But the FreeRTOS spends in IDLE much more time than only 2 (in ma case ms).