SYMPTOM
When I declare following global variable in my application, my program goes into DataAbort mode before it reaches main():
struct vectCntlFields { unsigned int source:5 ; unsigned int enable:1 ; }; volatile struct vectCntlFields vectCntlSlot0 __at 0xFFFFF200;
CAUSE
The CARM compiler automatically initializes global variables. This results in an illegal byte-access to an register of the VIC (VECTORED INTERRUPT CONTROLLER). All registers in the VIC are word registers. Byte and halfword reads and write are not supported.
RESOLUTION
Instruct the compiler not to initialize your variables in the VIC register address space. Your code above should read:
struct vectCntlFields { unsigned int source:5 ; unsigned int enable:1 ; }; #pragma SAVE #pragma NOINIT volatile struct vectCntlFields vectCntlSlot0 __at 0xFFFFF200; #pragma INIT