| ARM Technical Support Knowledge Articles | |
Applies to: ARM Developer Suite (ADS), RealView Developer Kit (RVDK) for OKI, RealView Developer Kit for XScale (RVXDK), RealView Development Suite (RVDS)
The initialization code/data from within the C library that does the copying from load to execution addresses must be placed in a root region (i.e. one which executes at its load address). This is because this code/data cannot itself be copied. This means that the scatter description file must have at least one root region that must contain:
If these sections named Region$$Table and ZISection$$Table are not placed in a root region then the linker will report:
Error: L6202E: Section Region$$Table cannot be assigned to a non-root region. Error: L6202E: Section ZISection$$Table cannot be assigned to a non-root region.
In many cases this code/data may be placed in a root region by use of a wildcard *(+RO) that gathers all non-explicitly placed code/data. However in some circumstances, this wildcard may need to be placed in a non-root region, in which case a scatter file similar to the one below may be used.
Example scatter file for ADS and RVCT 2.0:
LOAD_FLASH 0x04000000 0x80000 ;start address and length
{
EXEC_FLASH 0x04000000 0x80000
{
init.o (Init,+FIRST) ; remap & init code
__main.o (+RO) ; copy code
* (Region$$Table) ; RO/RW addresses to copy
* (ZISection$$Table) ; ZI addresses to zero
}
EXEC_32bitRAM 0x0000 0x2000
{
vectors.o (Vect,+FIRST) ; vector table
int_handler.o (+RO) ; interrupt handler
}
EXEC_16bitRAM 0x2000 0x80000
{
* (+RO) ; ## all other RO areas ##
* (+RW,+ZI) ; program variables
}
}
For RVCT 2.1 and later, an alternative way is to specify these sections using InRoot$$Sections:
LOAD_FLASH 0x04000000 0x80000 ;start address and length
{
EXEC_FLASH 0x04000000 0x80000
{
init.o (Init,+FIRST) ; remap & init code
* (InRoot$$Sections) ; using InRoot$$Sections
}
...
}
An application's initial entry point must also be rooted. If the initial entry point is not in a root region, the link will fail with an error such as:
Error: L6203E: Entry point (0x08000000) lies within non-root region EXE_FLASH.
Article last edited on: 2009-07-08 13:20:30
Did you find this article helpful? Yes No
How can we improve this article?