ARM Technical Support Knowledge Articles

LPC2000 APPLICATION DOES NOT REACH MAIN

Applies to: ARM Development Tools

Answer


Information in this article applies to:


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

Article last edited on: 2005-07-15 09:35:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential