Datasheet

Migrating Projects from SDT to ADS
4-14 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0064D
There are no Embedded C libraries supplied with ADS because the standard C libraries
can be retargeted for embedded use. However, the standard libraries must be initialized.
This is normally done through
main()
.
This means that you must have a
main()
function if you use the C libraries in ADS. If
you are moving a project from SDT to ADS, rename
C_Entry()
to
main()
.
See the section on tailoring the C library to a new execution environment in the ADS
Compilers and Libraries Guide for more information on retargeting the C libraries.
Library Entry Point
With the SDT, you typically call
C_Entry
from some assembler initialization code that
initializes, for example, stack pointers.
With ADS,
__main
is the entry point for the C library. Change your initialization code to
branch to __main instead of
C_Entry
. For example, change:
BL C_Entry
to:
B __main
Use a
B
instruction (not
BL
) because an application will never return this way.
RW/RO and ZI Region Initialization
With the SDT, you must write your own code to initialize RW and ZI variables and to
relocate RO code to RAM, if required. That is, you must copy the RW and RO data and
code from ROM to RAM, and zero the ZI data.
With ADS you do not need to write your own initialization code because the C library
code within
__main()
:
1. Copies non-root RW and RO execution regions from their load addresses to their
execution addresses.
2. Zeroes ZI regions.
3. Branches to
__rt_entry
, to initialize the library, which ultimately calls your
main()
.
If you are moving from SDT to ADS you can remove or comment out the redundant
initialization code.
If you want to continue using your own initialization code to perform RO, RW execution
region and ZI initialization, define your own
__main
that branches to
__rt_entry
: