Datasheet

Migrating Projects from SDT to ADS
ARM DUI 0064D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-15
IMPORT __rt_entry
EXPORT __main
ENTRY
__main
B __rt_entry
See the description of how C and C++ programs use the library functions in the C library
chapter of the ADS Compilers and Libraries Guide.
Memory Mapped Peripherals
If you have C variables mapped onto the registers of, for example, memory mapped
peripherals, you can instruct the ADS library not to zero-initialize them.
Example 4-2 defines a C structure mapped onto some peripheral registers in a file called
iovar.c
:
Example 4-2 iovar.c
struct {
volatile unsigned reg1; /* timer control */
volatile unsigned reg2; /* timer value */
} timer_reg;
Example 4-3 adds a root region to the scatter-load description file to place the output
from
iovar.c
at the required address in the memory map. The region is labeled
UNINIT
to ensure that the ZI section is not zero-initialized.
Example 4-3 Scatter-load description for iovar.c
IO 0x40000000
{
IO 0x40000000 UNINIT
{
iovar.o (+ZI)
}
}