| |||||
Technical Support Support Resources
Product Information | ARM: LPC2000 APPLICATION DOES NOT REACH MAINInformation in this article applies to:
SYMPTOMWhen 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;
CAUSEThe 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. RESOLUTIONInstruct 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
MORE INFORMATIONSEE ALSO
Last Reviewed: Friday, July 15, 2005 | ||||
| |||||