| |||
| Home > Altering the Target Execution Environment > Loading the contents of a file into memory | |||
You can load all or part of the contents of a file into target memory.
Before you can load the contents of a file into target memory, you must have downloaded a memory range into a file:
for binary file types (raw, raw8,
and raw16), the file must contain at least the
memory range you want to load
for other file types (obj and ascii),
the file is read from the beginning, but it is written to memory
starting at the address specified in the file, plus the offset you
specify.
To load the contents of a file into memory:
Select Debug → Memory/Register Operations → Upload/Download Memory file... from the Code window main menu to display the Upload/Download file from/to Memory dialog box. Figure 14.22 shows an example:
Specify the operation and set up the controls, as follows:
Select the Load File into Memory radio button.
In the File: field, enter the full path name of the file to use to read/write memory values.
In the Type of File section of the dialog, select the data type that you used when the specified file was saved:
obj specifies an object file
in the standard executable target format, for example ARM-ELF for
ARM architecture-based targets.
raw specifies raw data using
the most efficient access size for the target.
raw32 specifies a data file as
a stream of 32-bit values.
raw16 specifies a data file as
a stream of 16-bit values.
raw8 specifies a data file as
a stream of 8-bit values.
ascii specifies a space-separated
file of hexadecimal values. A header line at the start of the file
describes the file format:
[start,end,size]
where:
and start specifies
the address rangeend
is
a character that indicates the size of each value, where sizeb is
8 bits, h is 16 bits and l is
32 bits.
In the Location: field, specify the start location of the memory block where the contents are to be written:
If the file type is obj, then
you have only to specify a start location, for example:
0x88A0
main
If the file type is ascii, then
specify a signed offset from the start location that is stored in
the ASCII file.
For example, if the stored location is 0x8000 and
you want to load the file starting at 0x9000,
then enter 0x1000.
If the data type is one of raw, raw8, raw16,
or raw32, then you can enter:
a start address (0x88A0)
an address range (0x88A0..0x8980)
a start address and length (0x88A0..+1000 or main..+1000).
If you specify an address range or a start address and length that is greater than the size of the file, then RealView Debugger stops writing to memory when the end of the file is reached. For example, if 50 bytes of memory are stored in the file, and you specify a length of 100, then only 50 bytes are written to memory.
If required, use the drop-down arrow to select a previously used location from the stored list.
Click Apply to load the memory from the specified file.
If you are loading to Flash, then the Flash Memory Control dialog box is displayed.
Click Close to close the Upload/Download file to/from Memory dialog box.
See also: