| |||
| Home > RealView Debugger Commands > Alphabetical command reference > WRITEFILE | |||
The WRITEFILE command writes the contents of memory to a file, performing a format conversion if necessary.
WRITEFILE ,{OBJ|raw|rawb|rawhw|ascii[,opts]} filename =addressrange
where:
OBJWrite the file in the standard executable target format. For ARM targets, this is ARM-ELF.
There are no supported
for this file type.opts
rawWrite the file as raw data, one word per word of memory.
There are no supported
for this file type.opts
You must specify an address with this qualifier.
rawbWrite the file as raw data, one byte per byte of memory.
There are no supported
for this file type.opts
You must specify an address with this qualifier.
rawhwWrite the file as raw data, one halfword per halfword of memory.
There are no supported
for this file type.opts
You must specify an address with this qualifier.
asciiWrite
the file as a stream of ASCII digits separated by whitespace. The exact
format is specified by other qualifiers (see the qualifier).
The file has a one line header that is compatible with READFILE and VERIFYFILE. This
header has the following format:opts
[start,end,size]
and start specifies
the address range that is written. end is
a character that indicates the size of each value, where sizeb is
8 bits, h is 16 bits and l is
32 bits.
optsOptional qualifiers available for use with the ascii qualifier:
byteThe file is a stream of 8-bit hexadecimal values that are written to the file without extra interpretation.
halfThe file is a stream of 16-bit hexadecimal values.
longThe file is a stream of 32-bit hexadecimal values.
guiYou are prompted to enter the file type with a dialog.
This qualifier has no effect in the headless debugger.
filenameThe name of the file to be written.
You can include one of more environment variables in the filename.
For example, if MYPATH defines the location C:\Myfiles,
you can specify:
writefile,raw "$MYPATH\\myfile.dat" 0x8000..0x8100
addressrangeThe address range in target memory to write to the
file. Specify an address range as: ,
for example start_addr..end_addr0x8000..0x9000.
The WRITEFILE command writes the contents of memory to a file, performing a format conversion if necessary.
The type of memory assumed depends on the target processor. For example, ARM processors have byte addressable memory and CEVA-Oak processors have word addressable memory.
The following examples show how to use WRITEFILE:
writefile ,raw "c:\temp\file.dat"
=0x8000..0x9000Write the contents
of the 4KB memory page at 0x8000 to the file c:\temp\file.dat,
storing the data in raw, uninterpreted, form.
writefile ,ascii,long
"c:\temp\file.txt" =0x8000..0x9000Write
the contents of the 4KB memory page at 0x8000 to
the file c:\temp\file.dat, storing it as 32-bit
values in target memory endianess. For example, the file might look
similar to this:
[0x8000,0x9000,l]
E28F8090 E898000F E0800008 E0811008
E0822008 E0833008 E240B001 E242C001
E1500001 0A00000E E8B00070 E1540005
...
By writing a file as longs and reading
it back as longs on a different target, you can
convert the endianness of the data in the file.
The following commands provide similar or related functionality: