10.7.4. Initializing execution regions

This example uses region initialization code (regioninit.s) to perform all the initialization required before branching to the main C application code. The region initialization code copies RO code and RW data from ROM to RAM, and zero-initializes the ZI data areas used by the C code.

The function InitRegions() in regioninit.s uses a macro called RegionInit to initialize the specified execution regions. These execution region names match those given in the scatter load description file scat.txt:

macro_RegionInit  32bitRAM
macro_RegionInit  16bitRAM

To re-use this code in your own scatter-loaded applications, call the macro RegionInit for each of your execution regions.


The initialization code should move all the execution regions from their load addresses to their execution addresses before creating any zero-initialized areas. This ensures that the creation of a zero-initialized area does not overwrite any execution region contents before they are moved from their load address to their execution address. Failure to do so may produce unpredictable results when the image executes.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D