Keil Logo

ARM: LPC2000 APPLICATION DOES NOT REACH MAIN


Information in this article applies to:

  • ARM Tools All Versions

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

MORE INFORMATION

SEE ALSO

  • Refer to NOINIT in the CARM User's Guide.

Last Reviewed: Monday, December 22, 2014


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.