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

freertos data abort, GCC OPTIM > 0 at91sam7

Posted 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 at91sam7

Posted 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 at91sam7

Posted 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 at91sam7

Posted 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 at91sa

Posted 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 at91sa

Posted 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 at91sa

Posted 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 at91sa

Posted 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).


[ 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