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] [March 2008 Threads] freertos data abort, GCC OPTIM > 0 at91sam7Posted by danilo vendruscolo on March 5, 2008 hello,
i am writing this to tell you a problem i am facing: when I turn on optimization with gcc, any level ranging from 1 to 3, my system won´t run, it crashes with undf or data abort. If I turn it off, my system runs without any problem. The system crashes if I use the -fomit option too.
I am using yagarto gcc 4.2.2 and at91sam7xc256, freertos 4.7.1, lwip 1.2.0.
does anyone have any idea what is going ?
thanks in advance,
danilo
RE: freertos data abort, GCC OPTIM > 0 at91sam7Posted by Dave on March 5, 2008 Two things to suggest you could try.
First, stop the debugger after the crash to see where you are. I guess you will be in an abort handler. If so look at the abort link register to find the instruction that caused to exception.
Second, remove most of your application code and definitely remove lwip. Then write a simple task that does nothing but flashes an LED.
void vtask( void *v ) { for(;;) { vTaskDelay(1000); vParTestToggleLED(0); } }
See if this runs ok.
RE: freertos data abort, GCC OPTIM > 0 at91sam7Posted by Richard on March 5, 2008 I am still using GCC 4.2.1. Are there any significant changes in the optimisation in 4.2.2? Could you try your application with V4.2.1?
Regards.
RE: freertos data abort, GCC OPTIM > 0 at91sam7Posted by Richard on March 5, 2008 I just downloaded the latest V4.2.2 Yagarto and tried it with the ARM7_AT91SAM7X256_Eclipse project at -O0, -O3 and -Os optimisation levels with no problems.
Regards.
RE: freertos data abort, GCC OPTIM > 0 at91saPosted by danilo vendruscolo on March 5, 2008 hi,
thanks for the replies, I made the led test and it worked too. So I investigated deeper into my code and disabled two interrupts I had, TC0 and SSC. Then everything worked. What is funny is that the code works without problems when I have no optimization. Either of them enabled, it does not work. moreover, there is no context switch from within these two ISRs.
i will try to debug more. will post here the results.
RE: freertos data abort, GCC OPTIM > 0 at91saPosted by danilo vendruscolo on March 6, 2008 hi,
i´ve made it work, i had to use the naked attribute and the port save context, the same thing other interrupts that cause a context switch does, but even when it is not the case. please, if possible, change the lwip rowley documentation to warn other users too.
thanks,
danilo
RE: freertos data abort, GCC OPTIM > 0 at91saPosted by woops_ on March 6, 2008 You have probably experienced the __attribute__(IRQ) bug that is in the code sorcery version of GCC.
RE: freertos data abort, GCC OPTIM > 0 at91saPosted by danilo vendruscolo on March 6, 2008 as I said before, I was using yagarto gcc 4.2.2.
i have just checked google, and found this, but it seems rather old, 2005. Weird that it hasn´t been fixed yet.
thanks,
danilo
http://gcc.gnu.org/ml/gcc-bugs/2005-12/msg01563.html
[Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
* From: "th dot r dot klein at web dot de" <gcc-bugzilla at gcc dot gnu dot org> * To: gcc-bugs at gcc dot gnu dot org * Date: 15 Dec 2005 14:57:21 -0000 * Subject: [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) * Reply-to: gcc-bugzilla at gcc dot gnu dot org
If a little bit more complex interrupt function is required the compiler genrates wrong code (olny with -O flag set).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|