Quality RTOS & Embedded Software

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


I need help with a blocking Queue

Posted by Fernando Gatto on June 5, 2008
I have a task that it blocks waiting for an item to be posted on a queue. The item is posted from an ISR. The first item posted on the queue unblocks the task successfully. The second item also unblock the task but when the task returns to the blocking receive the system get stuck. I don´t see anything strange in the memory, the stacks of the tasks are ok. I tried everything, I removed all the code from the task, I only leaved a led toggle. I need suggestions of what could be the problem.


RE: I need help with a blocking Queue

Posted by Richard on June 5, 2008
Its a bit tricky to offer suggestions as its quite a high level description of the problem. Can you step into the code when the third item is posted to the queue to see that there is in fact a task blocked on the queue when the item is posted, and that this task is then unblocked during the post?


RE: I need help with a blocking Queue

Posted by Fernando Gatto on June 5, 2008
Thanks Richard for your support. After the second post on the queue the task gets unblocked but when it returns to the xqueue
receive the program get lost. I changed the xqueue receive to another task and the system get blocked on the first post. It seems that some variable of the kernel get corrupted. After the frozen, if you look with the debugger the ram content, it is very similar to the previous state, there isn´t a big ram area corrupted. Now I´m trying to look which one is the corrupted.

Is all the information about a task in the TCB? and Is all the information about a Queue in the xqueue handle? or Is there any other area whith relevant information that could be damaged?


RE: I need help with a blocking Queue

Posted by Dave on June 6, 2008
The other place to check is the stack. Has the stack overflowed? http://www.freertos.org/Stacks-and-stack-overflow-checking.html

RE: I need help with a blocking Queue

Posted by Fernando Gatto on June 6, 2008
Thanks Davedoors for your help. I´ve checked the stacks of the stacks and everything looks fine. In order to test I´ve quited everything. I´ve only have three tasks waiting for a byte to be posted on three differents queue each one, and. I have only a timer based interrupt with a little state machine and appart from the rtos timer nothing else is running. If in the interrupt I post a byte in only one queue the corresponding task gets unblocked it toggles a led and the system doesn´t crash. But when i post on two queues is when the problems begins. Depending the combinations the system crash with differents patterns but is always the same, you reset the system and sequence before crash is always the same.


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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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