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


GCC "naked" attribute on GCC...

Posted by dave m on October 14, 2010
I'm getting back to some ARM programming after a while using AVR. I'd upgraded GCC a few times along the way, so I'm using 4.4.0 (and tried 4.5.1). I can't compile examples because of an internal compiler error associated with the naked attribute used on various ISRs and low-level functions. Looking through the GCC mailing lists and wikis, it appears that "naked" functions can no longer have arguments, local variables, or anything really except asm() statements.

Has anybody in the FreeRTOS community encountered this? Solved it? Perhaps I should just downgrade to 4.3.2 or something?


RE: GCC "naked" attribute on GCC...

Posted by Dave on October 14, 2010
I don't think any naked functions in FreeRTOS have any attributes as they are all ISRs. Where exactly in the FreeRTOS code is the problem occurring?

Some naked functions contain C code, but these can be converted to asm easily if it is causing you a problem.

The compiler should not crash no matter what you feed it so it sounds like a compiler bug. I am using V4.4.2 ok.

RE: GCC "naked" attribute on GCC...

Posted by dave m on October 14, 2010
My compilation of JC Wren's LPC2148 sample code was crashing on some of his ISR code, not on the "naked" functions in the FreeRTOS-5.1.0 code that he uses. I posted here because I thought the FreeRTOS people might have encountered this and solved it. The people talking about it elsewhere appear to be Linux-ARM people and/or GCC people, and discussion tends to peter out after somebody points out that the GCC docs say "nothing but asm() allowed in naked functions."

(There is agreement that the compiler shouldn't crash in any case, but apparently it's harder to fix the crash than one might like, plus it could be that not many people outside the embedded community are encountering the problem.)

Anyway, my problem is not that I don't know how to fix it / convert to non-naked, but that I'd rather do it without hacking up other people's code, so for example I can drop in a new version of FreeRTOS when it comes out.

I've had success by just reverting to GCC-4.3.2, so I'll use that until the compiler guys figure out the Right Way to deal with this.


RE: GCC "naked" attribute on GCC...

Posted by Ben on October 14, 2010
Am using GCC 4.4.3 and naked ISR functions without any problems. I have never used local variables though as there is no stack setup for them when declaring the function as naked. If I need variables I just call another C function declared normally.

[ 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