FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2009 Threads] vTaskSuspend()Posted by fkln on February 20, 2009 I am working with STM32 and GCC. My program have several tasks which communicate with two Queues, a Counting Semaphore and a Mutex. For debugging, I have implemented some of the Trace Hook Macros.
If I do a xQueueReceive(RxQueue, &value, portMAX_DELAY) to an empty queue, I see that the traceTASK_SUSPEND() macro is active in the actual running task and that this task is restarted at the beginning again.
Is this possible / correct ?
RE: vTaskSuspend()Posted by Richard on February 21, 2009 I can understand that this would be unexpected, but it is actually correct.
When a task wants to block indefinitely it is actually placed onto the suspended list rather than a blocked list - this is because tasks on the blocked list must have a timeout. Even thought the suspended list is used, the task is in the Blocked state not the Suspended state.
Regards.
RE: vTaskSuspend()Posted by fkln on February 22, 2009 With your explanation the program is now running.
The problem was, that I have taken a Mutex and later I was receiving characters with xQueueReceive(RxQueue, &value, portMAX_DELAY) in the same task. Because the queue was still waiting of more values, the task was suspended and the mutex was lost forever. Perhaps you can add this hint to your FreeRTOS eBook.
Thanks,
Klaus.
RE: vTaskSuspend()Posted by fkln on February 22, 2009 With your explanation the program is now running.
The problem was, that I have taken a Mutex and later I was receiving characters with xQueueReceive(RxQueue, &value, portMAX_DELAY) in the same task. Because the queue was still waiting of more values, the task was suspended and the mutex was lost forever. Perhaps you can add this hint to your FreeRTOS eBook.
Thanks,
Klaus.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|