Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner