ARM VERSION 1.2 Guide de l'utilisateur Page 76

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 133
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 75
6 Writing Code for ROM
This chapter describes how to build images for embedded applications. These images are typically programmed into
ROM or flash memory. There are also suggestions on how to avoid the most common errors in writing code for
ROM.
This chapter contains the following sections:
About writing code for ROM
Memory map considerations
Initializing the system
The reference C example using semihosting
Loading the ROM image at address 0
Loading the ROM image at address 0
Using both scatter loading and remapping
A semihosted application with interrupt handling
An embeddable application with interrupt handling
Using scatter loading with memory-mapped I/O
Troubleshooting.
Measuring code and data size.
6.1 About writing code for ROM
This chapter describes how to write code for ROM, and shows different methods for simple and complex images.
Sample initialization code is given, as well as information on initializing data, stack pointers, interrupts, and so on.
This chapter contains examples of using scatter loading to build complex images. For detailed reference information
on the linker and scatter loading, refer to Linker and Utilities Guide
.
Note
The examples used in this chapter target the ARM Integrator board and are located in
install_directory\Examples\embedded. You can use these examples as the basis for the initialization code
for your own system.
The reference examples (embed, embed_cpp, ledflash, and rps_irq) can be built in different configurations in
increasing levels of complexity:
As a simple semihosted application that links with the C libraries. This example uses the semihosting SWI
functions of the C libraries for I/O. See The reference C example using semihosting.
As an application that links with the C libraries and can be embedded into ROM to execute at address 0x0
using scatter loading. This example does not use the semihosting SWI functions, but instead uses a retargeting
layer for I/O. See Loading the ROM image at address 0.
As an application that uses scatter loading and memory remapping to move RAM to 0x0 after initialization. See
Using both scatter loading and remapping.
Additional files are provided to demonstrate function retargeting and processor initialization:
retarget.c implements a retargetting layer for low level input/output
stack.s, heap.s, uart.c, and scat_c.scf demonstrate placement of stack and heap and
memory-mapped peripherals using the scatter file
init.s demonstrates the use of lengths and offsets to initialize stack pointers for each mode
the cache subdirectory contains cache and clock initialization code for a variety of ARM cores.
CodeWarrior IDE projects are available for the examples as embed.mcp, embed_cpp.mcp, ledflash.mcp, and
rps_irq.mcp.
Additional code examples and information about writing code for ROM is in the ARM Firmware Suite (AFS) example
code and documentation. Refer to the following ARM publications for more details on AFS:
ARM Firmware Suite User Guide
ARM Firmware Suite Reference Guide.
Writing Code for ROM
Copyright ?1999 2001 ARM Limited 6-1
Vue de la page 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 132 133

Commentaires sur ces manuels

Pas de commentaire