Quality RTOS & Embedded Software

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


Loading

probably FreeRTOS bug found!

Posted by Nobody/Anonymous on December 21, 2006
i have probably found a bug in tasks.c:

instead of this line in xTaskCreate():
pxTopOfStack = pxNewTCB->pxStack + ( pxNewTCB->usStackDepth - 1 );

the following line has to be written:
pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 );


am i right??

RE: probably FreeRTOS bug found!

Posted by Nobody/Anonymous on December 21, 2006
No -

In prvInitialiseTCBVariables():

pxTCB->usStackDepth = usStackDepth;

Therefore:

pxTopOfStack = pxNewTCB->pxStack + ( pxNewTCB->usStackDepth - 1 );
and
pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 );

are the same.

Is your pxNewTCB->usStackDepth varaible getting corrupt?

Step through the code following the assignment to see where the corruption occurs. Sounds like you might have a linker configuration error.

RE: probably FreeRTOS bug found!

Posted by Nobody/Anonymous on December 21, 2006
"Sounds like you might have a linker configuration error. "
what could I have done wrong at the linker settings?
I use the H8S2398 CPU with 8k RAM

the sections I use are:
.vects 0x00000000
.text 0x00000400
.bss 0x00FFDC00
.stack 0x00FFFBF0

is this wrong?
with the original code it worked for stack sizes until 255, if I use 256
pxNewTCB->usStackDepth gets a value of 0x10000

with my modification it works.
???

RE: probably FreeRTOS bug found!

Posted by Jeff Smith on December 26, 2006
I have sometimes noticed where the choice of code seems to fail to optimize for size nor speed. So why (pxNewTCB->usStackDepth - 1) instead of (usStackDepth - 1) When obviously the latter would excecute better? Shoot, is this RTOS, or is this MS?


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




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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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