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

GCC ARM port and use of -fomit-frame-pointer

Posted by Glen B. on April 14, 2007
I see the GCC ARM port issue regarding thread unsafe function returns is still biting people. I find the use of -fomit-frame-pointer interferes with some debuggers' abilities to unwind the stack. Some time ago I suggested a FreeRTOS port fix for it. I have been using the fix successfully for some time now. It seems to take care of the issue. I think it should be in the official ARM port so that the problem doesn't keep coming back.

Here it is again (without explanation):
In the portSAVE_CONTEXT() macro of portmacro.h add the commented line in the position shown below

____/* Set R0 to point to the task stack pointer. */ \
________"STMDBSP,{SP}^ \n\t" \
________"NOP \n\t" \
________"SUBSP, SP, #4 \n\t" \
________"LDMIASP!,{R0} \n\t" \
\
/*gb - step over possible GCC stacked items (GCC bug)*/ \
________"SUBR0, R0, #8 \n\t" \



RE: GCC ARM port and use of -fomit-frame-pointer

Posted by Nobody/Anonymous on April 19, 2007
No response to this? Looks like a good idea.

Does this mean it uses an extra 8 bytes of RAM for each context? Should not be a problem I don't think.

RE: GCC ARM port and use of -fomit-frame-pointer

Posted by Glen B. on April 19, 2007
Yes, eight bytes of stack space are wasted for each task, except the running task (and except for those tasks that were in the non thread-safe state when their context was saved). Also, the cost of a context switch goes up by the execution of one register-to-register instruction.


[ 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