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


Invalid entry in xPendingReadyList

Posted by Dick on April 19, 2012
I'm running FreeRTOS V7.1.0 on an MSPF5419A.
My ISR supporting an accelerometer gets called when that devices FIFO reaches a specified watermark level.
In the ISR I'm doing a xSemaphoreGiveFromISR on a semaphore and if that method returns pdTRUE calling portYIELD_FROM_ISR passing the variable that was set by the semaphore give. This wakes a task that is blocked on the semaphore which then drains the FIFO. All this works fine. The problem is that intermittently the xPendingReadyList is getting an entry (always 0xF3FFF) which clearly does not correspond to the address of any of my 7 TCBs. This doesn't usually happen until the system has run for anywhere from 3 to 5 minutes. With this invalid entry things quickly deteriorate and my watch dog timer resets the system. The variables on either side of xPendingReadyList look fine so it doesn't appear to be caused by memory being clobbered.

Any one have any thoughts as to what could be causing this?



RE: Invalid entry in xPendingReadyList

Posted by MEdwards on April 19, 2012
The first thing to check for is stack overflow. Do you have configCHECK_FOR_STACK_OVERFLOW set to 2, and a stack overflow hook defined?

You might also get some hints from here http://www.freertos.org/FAQHelp.html

RE: Invalid entry in xPendingReadyList

Posted by Dick on April 26, 2012
Yes, stack overflow was my first thought, however not only have I enabled the stack overflow checking as you suggested but also added a method to tasks.c that is called by vTaskSwitchContext. I have a vector of pointer to all the TCBs for the tasks I've launched and this method verifies that for every task pxTCB->pxStack is still 0xA5A5. If not it will halt at a breakpoint. That breakpoint never occurs.

I've also added another method to tasks.c whose purpose is to verify that the pointer to a TCB which is just about to be inserted into a list is valid (again using my vector of saved pointers to TCBs). This is the one which is catching an invalid pointer which is just about to be inserted into the xPendingReadList.

RE: Invalid entry in xPendingReadyList

Posted by rafleury on April 26, 2012
I had a similar problem last week. I dont know the details about your chip, but on the Cortex M3 there is a main stack that gets used for interrupts. That stack is not checked for overflow by FreeRTOS (is my understanding now), and was overflowing in my chip, with very similar symptoms as to what you describe.

RE: Invalid entry in xPendingReadyList

Posted by Dick on May 21, 2012
Having been unable to determine the root cause of this problem (its not a stack overflow) I decided to upgrade to V7.1.1.
After doing that I ran our application for over 49 hours over the weekend without any problems.
Prior to the upgrade it would crash after a few minutes.

I really don't know if I can claim the problem to be fixed, but for the moment things are solid.


[ 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