ARM ARM DUI 0224I manual Building an application with the platform library

Models: ARM DUI 0224I

1 402
Download 402 pages 14.06 Kb
Page 59
Image 59

Getting Started

2.6.6Building 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-21 to redirect standard I/O either to the debugger or to be handled by the application itself.

ARM DUI 0224I

Copyright © 2003-2010 ARM Limited. All rights reserved.

2-23

Page 59
Image 59
ARM ARM DUI 0224I manual Building an application with the platform library