We are currently investigating processors to use in a new product design. I've written some sample code that compiles (with GCC under Linux) and runs seamlessly on ARM Cortex A9 processors from various semiconductor manufacturers (I.MX6, ...) .
When running this code on an I.MX28 EVK, the code seems to function. However, it's slow. It gives a few thousand of these messages in the process of running the test:
Alignment trap: test (29858) PC=... Instr=... Address=... FSR ...
Looking at the GCC manual, there are mentions of unaligned access traps being enabled and disabled with the -malignment-traps and -mno-alignment-traps options. However, it says that these options do not effect ARM architecture 4 or later.
The I.MX28 ARM9 architecture is ARMv5, while Cortex A9 is ARMv7. Both of these are above architecture 4.
Does anyone have any insight into what could be going on here? What's the difference between these two architectures?
We could change the code to explicitly access memory on even boundaries, but if it is unnecessary on newer ARM architectures then we could prefer not to design for an older architecture.