| |||
| Home > Boot Monitor and platform library > Using the baseboard Boot Monitor and platform library > Loading and running an application from NOR flash | |||
To run an image from NOR flash:
Build the application as described in Building an application with the platform library and specify a link address suitable for flash. There are the following options for selecting the address:
The image is linked such that its load region, though
not necessarily its execution region, is in flash. The load region
specified when the image was linked is used as the location in flash
and the FLASH_ADDRESS option is ignored. If the blocks in flash
are not free, the command fails. Use the FLASH RUN command
to run the image.
The image is
programmed into the first available contiguous set of blocks in
flash that is large enough to hold the image. Use the FLASH LOAD and
then the FLASH RUN commands to load and run the
image.
Use
the FLASH_ADDRESS option to specify the location of the image in
flash. If the option is not used, the image is programmed into the
first available contiguous set of blocks in flash that is large
enough to hold the image. Use the FLASH LOAD or FLASH
RUN commands to load and run the image.
Images with multiple load regions are not supported.
If the image is loaded into flash, but the FLASH
RUN command relocates code to DRAM for execution, the
execution address must not be in the top 4MBytes of DRAM since this
is used by the Boot Monitor.
The image must be programmed into flash using the Boot Monitor. Flash support is implemented in the Boot Monitor image.
Run the Boot Monitor image from the debugger and enter the
flash subsystem, type FLASH at the prompt:
>FLASH flash>
The command used to program the image depends on the type of image:
The entry point and load address for ELF images are taken from the image itself. To program the ELF image into flash, use the following command line:
flash> WRITE IMAGEelf_file_nameNAMEnameFLASH_ADDRESSaddress
The entry point and load address for ELF images are taken from the command line options. To program a binary image into flash, use the following command line:
flash> WRITE BINARYimage_file_nameNAMEnameFLASH_ADDRESSaddress1LOAD_ADDRESSaddress2ENTRY_POINTaddress3
is a short
name for the image. If the nameNAME option is not
used at the command prompt, will
be derived from the file name. name
The image is now in flash and can be run by the Boot Monitor. At the prompt, type:
flash> RUN name