Most chips basded on the ARM architecture are comlex on-chip systems, in which most of the hardware modules, whose working statuses are set by softwares, are configurable. Right after the system starts up, before running applications, a block of codes has to be executed to initialize the system. Generally speaking, the initialization should consist of the following steps:
* Interrupt vector table
* Initializing storage system
* Initializing stack
* Initializing the ports and devices that have special requirements
* Initializing excution environment for  user's applications
* Changing the processor mode
* Running main applications

Interrupt vector table
     The interrupt vector table must be located in the space that starts from address “0” and extends for 8X4 byte.
     Every time when an interrupt occurs, the ARM processor forcibly sets the PC pointer to be the address value of the related interrupt type in the vector table. Since each interrupt only takes up the storage space of one character in the vector table, an ARM instruction must be placed to make the program jump to other spaces in the storage, and then the interrupt can be executed.

     The source program of interrupt vector table is as below

AREA Boot ,CODE, READONLY 
ENTRY 
B  ResetHandler 
B  UndefHandler 
B  SWIHandler 
B  PreAbortHandler 
B  DataAbortHandler 

B  IRQHandler 
B  FIQHandler 

     In these codes, the keyword “ENTRY” is used so that these codes might not be regarded as redunancy and therefore optimized by the compiler.

     Make sure to link this code to the address “0” and make it to be the entry point of the whole program.


Initializing storage system
    Storage types and timing configuration:

    Generally, Flash and SRAM are both static storage devices, they can share the same storage interface. While DRAM, due to its specific characters such as dynamic refreshing and address line multiplexing, must be equipped with dedicated storage interface.

+ Recent posts