FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2013 Threads] Error with naked functions and newer GCCPosted 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 GCCPosted 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 GCCPosted 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 GCCPosted by richardbarry on November 7, 2013 Try changing the line:
rtcISR_Handler();
to
_asm volatile( "bl rtcISRHandler" );
Regards.
Error with naked functions and newer GCCPosted 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 GCCPosted 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 GCCPosted 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 GCCPosted 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 GCCPosted 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 GCCPosted 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 GCCPosted 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 GCCPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|