Memory address not aligned with leon2

Ingolf Steinbach ingolf.steinbach at googlemail.com
Wed Mar 19 15:12:56 UTC 2008


Bonjour, Stefane.

2008/3/17, Arquer Stephane <stephane.arquer at c-s.cnes.fr>:
>  I work with a custom leon2 bsp over Rtems 4.8.
>  I get the trap(0x07) : memory address not aligned at the address
>  0x400af460.
>
>  Could someone explain to me what this error is in simple words ?

You are probably accessing a 16, 32, or 64 bit value at an address
which is not suitably aligned: 16 bit: a0=0; 32/64 bit: a0=0 and a1=0
(a0 and a1 being address bits).

>  Do you have an idea where I could find the source of such a problem ?

This is often caused by a bad cast.

1. Try to locate the function at 0x400af460 (for instance using
sparc-rtemsXXX-nm).

2. If it is in your application: watch out for suspicious cast
operations. Or maybe you have forgotten to reset a "pack" attribute.

3. If it is in RTEMS, you might find out more if you run your
application in a debugger and place a breakpoint at the above address.

Bon courage!
Ingolf



More information about the users mailing list