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

Error with naked functions and newer GCC

Posted by smithbone on November 7, 2013

I'm trying to compile the LPC2148 demo from here:

http://jcwren.com/arm/

My arm gcc (Version 4.7.3) doesn't seem to like the way FreeRTOS does ISR functions and throws the following error:

rtcISR.c: In function ‘rtcISR’: rtcISR.c:66:7: error: local frame unavailable (naked function?) rtcISR.c:66: confused by earlier errors, bailing out make[1]: *** [rtcISR.o] Error 1

Looking up that error I found:

http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02321.html

Which suggest that gcc does not like that freeRTOS is using a naked function and then doing its own context saving.

Has anyone sorted this out?

My gcc details:

rsmith@thinko:/usr/local/arm-bobo/bin$ ./arm-elf-gcc -v Using built-in specs. COLLECTGCC=./arm-elf-gcc COLLECTLTO_WRAPPER=/usr/local/arm-bobo/libexec/gcc/arm-elf/4.7.3/lto-wrapper Target: arm-elf Configured with: ../gcc/configure --target=arm-elf --prefix=/usr/local/arm-bobo --enable-interwork --enable-multilib --disable-libssp --disable-werror --with-float=soft --enable-languages=c,c++ --with-newlib --with-headers=../newlib/newlib/libc/include --enable-obsolete Thread model: single gcc version 4.7.3 (GCC)


Error with naked functions and newer GCC

Posted by richardbarry on November 7, 2013

Sorry - we cannot support third party code - rtcISR.c is not something that is provided from the FreeRTOS website.

However, if you post the lines in that file that are causing the compiler problem then we may be able to suggest how it is corrected.

Regards.


Error with naked functions and newer GCC

Posted by smithbone on November 7, 2013

Ah my bad. The function is so simple that I thought it was a FreeRTOS wrapper function.

Its:

void rtcISR (void) attribute ((naked)); void rtcISR (void) { portSAVECONTEXT (); rtcISRHandler (); portRESTORE_CONTEXT (); }


Error with naked functions and newer GCC

Posted by richardbarry on November 7, 2013

Try changing the line:

rtcISR_Handler();

to

_asm volatile( "bl rtcISRHandler" );

Regards.


Error with naked functions and newer GCC

Posted by smithbone on November 7, 2013

Thanks. I'll try that. I was discovering that in the ARM7LPC2106GCC code. BTW you may want to check that port. It fails to compile for me.

rsmith@thinko:/home/src/FreeRTOSV7.5.2/FreeRTOS/Demo/ARM7LPC2106GCC$ make /usr/local/arm-bobo/bin/arm-elf-gcc -c -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused -D -D GCCARM7 -I. -I../../Source/include -I../Common/include -mcpu=arm7tdmi -T -fomit-frame-pointer -fno-strict-aliasing -fno-dwarf2-cfi-asm ../../Source/portable/GCC/ARM7LPC2000/portISR.c -o ../../Source/portable/GCC/ARM7LPC2000/portISR.o arm-elf-gcc: error: GCCARM7: No such file or directory make: *** [../../Source/portable/GCC/ARM7_LPC2000/portISR.o] Error 1


Error with naked functions and newer GCC

Posted by richardbarry on November 7, 2013

How did you try to build it? Did you follow the build instructions?

Regards.


Error with naked functions and newer GCC

Posted by smithbone on November 7, 2013

What build instructions are you referring to? The only thing I see is a readme.txt which very minimal and talks about running .bat files. I'm using Linux.

However, looking at the .bat files I see that there needs to be some environment variables defined. If I define some it works. So my bad for not a deep enough inspection, however, I think its a bug type 'make' and not have either:

1) Some defaults defined. 2) Throw an explicit error indicating the proper variables have not been defined.


Error with naked functions and newer GCC

Posted by smithbone on November 7, 2013

BTW. Thank you. This seems to work. I just have to go fix a lot of them.


Error with naked functions and newer GCC

Posted by richardbarry on November 7, 2013

What build instructions are you referring to?

Start with the quick start guide, it will tell you how to find the instructions to build the code, if you don't want to read the readme file that is placed next to the makefile in the directory itself:

http://www.freertos.org/FreeRTOS-quick-start-guide.html

Regards.


Error with naked functions and newer GCC

Posted by richardbarry on November 7, 2013

GCC has never handled interrupt entry in ARM very well, various different versions have contained various different bugs, and over the years all the mixing of C and ASM on interrupt entry was removed from the code.

From your initial post it sounds like they have given up trying to support it at all now, and just throw you out if you attempt use C code there - probably as most focus is on Cortex support in GCC now.

Regards.


Error with naked functions and newer GCC

Posted by smithbone on November 7, 2013

if you don't want to read the readme file that is placed next to the makefile in the directory itself:

That's my point. I did read the readme that is placed next to the makefile. It consists of 8 short lines that say run 1 of 4 .bat files. Nothing is mentioned about needing to do anything for Linux.

There are no corresponding shell script(s) for Linux. Barring any information stating otherwise as a Linux developer I expect type 'make' and have the makefile sort it out or if I saw a 'configure' script I would assume autotools is going to run.

I also took a quick look at the makefile which at a cursory inspection seems to be a self contained makefile.


Error with naked functions and newer GCC

Posted by edwards3 on November 7, 2013

You are looking at one of the original examples. It is very old and originally FreeRTOS was made available as an option for use on windows hosts as all the other open source RTOS out their were just for building on linux hosts.


[ 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