ARM ARM DUI 0224I Computer Hardware User Manual


 
Getting Started
ARM DUI 0224F Copyright © 2003-2007 ARM Limited. All rights reserved. 2-25
2.6.8 Building an application with the platform library
The platform library on the CD provides all required initialization code to bring the
PB926EJ-S up from reset. The library is used by the Boot Monitor, but it can be used
by an application independently of the other code in the Boot Monitor.
The platform library supports:
remapping of boot memory
SDRAM initialization
•UARTs
Time-of-Year clock
output to the character LCD display
C library system calls.
To build an image that uses the I/O and memory control features present in the platform
library:
1. Write the application as normal. There must be a
main()
routine in the application.
2. Link the application against the Boot Monitor platform library file
platform.a
.
The file
platform.a
is in one of the target build subdirectories
(
install_dir\software\firmware\Platform\Builds\target_build
). Choose the
Builds
subdirectory that matches your application. For example,
Release_ARM_Little_Endian
for ARM code.
Define the image entry point to be
__main
and the region
__main
to be the first
section in the execution region:
-entry __main -first __main
Note
If you are not using the
platform.a
library, you must provide your own
initialization and I/O routines.
You can also build the platform library functionality directly into your application
without building the platform code as a separate library. This might be useful, for
example, if you are using an IDE to develop your application.
See the
filelist.txt
file in the
software
directory for more details on software
included on the CD. The
selftest
directory, for example, contains source files
that can be used as a starting point for your own application.
To run the image from RAM, load the image with a debugger and execute as normal.
The image uses the procedure described in Redirecting character output to hardware
devices on page 2-23 to redirect standard I/O either to the debugger or to be handled by
the application itself.