So, I have an Olimex LPC-2378 dev board and have been doing some work on this for while now. I’ve been fighting an issue with it where it would randomly trigger the prefetch abort exception (usually within 30 seconds of running and sending data to it over the uart, which triggered most of the useful processing). I had also encountered cases where it would execute the “else” clause of an if-then-else block, even though it had also (correctly) executed the “if” part of the block. So, I started poking around and finally tried setting -falign-jumps=4, and voila, it started working reliably.
The arm7tdmi-s spec says that instructions need to be 16bit aligned for thumb, and 32bit aligned for arm. But this kind of thing should be handled by defaults in the compiler right? In all the other sample makefiles I’ve seen, I have not seen anyone use this option to get their code to work. Has anyone else experienced similar issues? Is there something totally different that I’m missing or am not considering?
Partial Excerpt of GCC command:
arm-elf-gcc -c -mcpu=arm7tdmi-s -O3 -gdwarf-2 -mthumb-interwork -mthumb -falign-jumps=4 -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm
note: gcc version is 4.2.1
Thoughts?
Thanks,
-Dave