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

xSemaphoreTake in FreeRTOS V4.7.2

Posted by Christian on June 27, 2008
Hello,

My project is dedicated for the Cortex M3 CPU. I'm cycling our board in order to test the firmware. I created several tasks, Some tasks wait for a binary semaphore. Each of them, I defined a block time to wait for the semaphore. One of them is 20 ms and the other one is 10 ms. The cycling test is to capture a signal from an input (using a timer capture). So I can get ~200 interrupts in 100 ms @ each 8 seconds. (signal --- wait 8 sec --- signal ---).

The problem is the following one. Sometimes, the os freezes in vListInsert() called from a xSemaphoreTake()...

It loops for ever in a for loop()

for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
{
/* There is nothing to do here, we are just iterating to the
wanted insertion position. */
}

We have 10 boards in cycling test, 9/10 boards got this problem < 15 minutes.

I'm using IAR to compile and debug the project.

I hope to get an answer from you soon.

Regards

Christian




RE: xSemaphoreTake in FreeRTOS V4.7.2

Posted by MEdwards on June 27, 2008
I would say you have most likely corrupted your data somewhere. Have you checked how much stack is left free in your tasks?

RE: xSemaphoreTake in FreeRTOS V4.7.2

Posted by Christian on June 27, 2008
Yeah each task has enough space in the stack. Is it a way to see how many space left in the stack? I verified in the memory window, I can count how many 0xA5 is present in each stack.


RE: xSemaphoreTake in FreeRTOS V4.7.2

Posted by DaWorm on August 14, 2008
Look at vTaskList to get a list of tasks and their min stack remaining (it shows the lowest free bytes, not the most used bytes).

I'm having the same problem, only with serial interrupts causing the problem. In my ISR, I read a queue to send data, write a queue with received data (just like the demos). Another task reading a queue will hang exactly the way you describe almost immediately if I have more than one serial port active, or after a few hours if only one is active. My stacks look fine (well over 100 bytes extra in each).


[ 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