Re: arm-elf-gcc building erroneous code for ISR (long posting)
From: Andras Tantos (andras_tantos_at_yahoo.com)
Date: Mon, 14 Jun 2004 14:03:51 -0700
You can download a newer (actually two: 3.3.1 and 3.4.0) GCC from my
webpage. I know they've fixed a serious ARM bugs in their IRQ handling
around 3.3.0. You might be hitting it.
-- Regards, Andras Tantos <http://andrast.tantos.homedns.org> "Jens Hildebrandt" <jens.hildebrandt@remove_this.etechnik.uni-rostock.de> wrote in message news:email@example.com... > Hello group, > > I'm curently trying to get familiar with the ARM7 by building some > example-projects for a LPC2106-controller. One such project is the blinky_irq > example from Keil which should demonstrate the use of interrupts and of the > LPC2xxx vectored interrupt controller. I'm using gcc-3.2.1 with binutils 3.13.1 > and newlib 1.11.0 . So far I had no problems with these tools and I was able to > build and succesfully run some small demonstrator programs (without interrupts) > on my LPC2106 board. For the blinky_irq example program I use the linker script > and startup.s files (with adjustment for the Flash and RAM sizes of the LPC2106) > that came with the source code from Keil's download area. Since the program > didn't work I stripped it from all unnecessary functionality (main() is > essentially an empty loop now) and simply let the timer ISR toggle a LED on > GPIO24. That worked initially, but after some time (~ 3 minutes) the LED stopped > toggling. I suspected that somwhere I'm loosing memory such that after some time > I'm out of RAM. Hence, I took a look at the disassembled code and saw that the > ISR is messing up the IRQ-mode stack pointer, loosing seven words each time the > ISR is invoked. > Since the ISR entry and exit codes are automatically generated by the compiler I > suspect a bug in gcc. On the other hand, since this would be a very severe > failure other users should have come across it, too. Does anybody of you know > that error (i.e. should I change to another gcc version) or am I missing > something (e.g. gcc options)? > Below you'll find the build commands used, the sources of the program and the > disassembled ISR code. > > TIA, > Jens >