Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists