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

Error in prvNotifyQueueSetContainer

Posted by ta8086 on September 15, 2014

It seems there is a bug in queue.c/prvNotifyQueueSetContainer(). The line

configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength );

looks OK, but throws assert each time I try to add last queue element (when ASSERTs are enabled). Maybe the sign must be "<=" instead of "<".


Error in prvNotifyQueueSetContainer

Posted by davedoors on September 15, 2014

I don't know it looks right to me. The same test is in the if() statement below it. It is checking there is space in the queue before trying to write to it. If it was <= it would pass if the queue set way full but then still try to write to it.


Error in prvNotifyQueueSetContainer

Posted by qtdave on November 3, 2015

We have found the same issue, the assertion fails with pxQueueSetContainer->uxMessagesWaiting equal to pxQueueSetContainer->uxLength.

Looking at the call stack prvNotifyQueueSetContainer is called from xQueueGenericSend

We are running FreeRTOS V8.2.1

Anyone else found a similiar issue?


Error in prvNotifyQueueSetContainer

Posted by davidlcamlin on March 29, 2017

Have similar issue, set the queue to 160 elements, periodically call xQueueSendToBack and after a while it fails in the same configAssert, having pxQueueSetContainer->uxMessagesWaiting = pxQueueSetContainer->uxLength = 2. I'm using FreeRTOS 9.0.0 on ATSAME70Q21. This queue is added into a set using xQueueCreateSet(2), maybe is related?


Error in prvNotifyQueueSetContainer

Posted by rtel on March 29, 2017

The test in the assert is valid. As already pointed out in this thread, it is checking the line below it doesn't fail, because if it did fail then the queue set would be in an inconsistent state.

When you are using a queue set you MUST ensure the number of spaces in the queue set is greater than or equal to the sum of all the spaces in the queues added to the set. If that is not the case then you can add something to a queue that is a set without the set ever knowing. That is what the assert is guarding against.

When you read from a queue set you MUST then also read from the queue. That is, if you read queue handle X from a queue set you MUST then read the item from queue X - again otherwise the queue set will be in an inconsistent state.


Error in prvNotifyQueueSetContainer

Posted by davidlcamlin on April 7, 2017

I created a set originally for 2 queues, one is receiving timer events (xQueueSendToBack) and the other from interrupt using xQueueSendToBackFromISR. Then when this thread waiting on xQueueSelectFromSet reports a message arrived in one of the queues, calls xQueueReceive on that queue immediately. I followed your suggestion and now the queue set is 3 (but no third queue added to the set). After about half a day of running, this assert is triggered again and pxQueueSetContainer->uxMessagesWaiting = pxQueueSetContainer->uxLength = 3. This thread doesn't wait on anything else and processing of the message (on the 2nd queue) from ISR is light enough since was used in other projects without any problems. Am I doing something wrong? Maybe the timer (1st) queue isn't processed quickly enough because the message from the 2nd queue is still being processed? But how is the set reporting 3 messages waiting when the third queue doesn't exist in the set? Do I need to call anything after xQueueSelectFromSet?


Error in prvNotifyQueueSetContainer

Posted by davidlcamlin on April 7, 2017

I might have found the cause of the assert triggered, I needed to use combined length of first and second queue to xQueueCreateSet.


Error in prvNotifyQueueSetContainer

Posted by rtel on April 7, 2017

Yes, that is well documented.


[ 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