Memory Read
Syntax
mrd [options] <address> [num]
Read <num>
data values from the
active target's memory address specified by <address>
.
Options
Option | Description |
---|---|
-force
|
Overwrite access protection. By default accesses to reserved and invalid address ranges are blocked. |
-size
<access-size>
|
<access-size> can be one of the values below: b
= Bytes accesses h = Half-word accesses w = Word accesses d =
Double-word accesses Default access size is w Address will be
aligned to access-size before reading memory, if '-unaligned-access'
option is not used. For targets which do not support double-word
access, debugger uses 2 word accesses. If number of data values to
be read is more than 1, then debugger selects appropriate access
size. For example, 1. mrd -size b 0x0 4 Debugger accesses one word
from the memory, displays 4 bytes. 2. mrd -size b 0x0 3 Debugger
accesses one half-word and one byte from the memory, displays 3
bytes. 3. mrd 0x0 3 Debugger accesses 3 words from the memory and
displays 3 words. |
-value
|
Return a Tcl list of values, instead of displaying the result on console. |
-bin
|
Return data read from the target in binary format. |
-file
<file-name>
|
Write binary data read from the target to <file-name> . |
-address-space
<name>
|
Access specified memory space instead default
memory space of current target. For Arm DAP
targets, address spaces DPR, APR and AP<n> can be used to access DP Registers, AP
Registers and MEM-AP addresses, respectively. For backwards
compatibility -arm-dap and -arm-ap options can be used as shorthand
for "-address-space APR" and "-address-space AP<n> ", respectively. The APR
address range is 0x0 - 0xfffc, where the higher 8 bits select an AP
and lower 8 bits are the register address for that AP. |
-unaligned-access
|
Memory address is not aligned to access size, before performing a read operation. Support for unaligned accesses is target architecture dependent. If this option is not specified, addresses are automatically aligned to access size. |
Note(s)
- Select a APU target to access Arm DAP and MEM-AP address space.
Returns
Memory addresses and data in requested format, if successful. Error string, if the target memory cannot be read.
Example(s)
mrd 0x0
Read a word at 0x0.
mrd 0x0 10
Read 10 words at 0x0.
mrd -value 0x0 10
Read 10 words at 0x0 and return a Tcl list of values.
mrd -size b 0x1 3
Read 3 bytes at address 0x1.
mrd -size h 0x2 2
Read 2 half-words at address 0x2.
mrd -bin -file mem.bin 0 100
Read 100 words at address 0x0 and write the binary data to mem.bin.
mrd -address-space APR 0x100
Read APB-AP CSW on Zynq. The higher 8 bits (0x1) select the APB-AP and lower 8 bits (0x0) is the address of CSW.
mrd -address-space APR 0x04
Read AHB-AP TAR on Zynq. The higher 8 bits (0x0) select the AHB-AP and lower 8 bits (0x4) is the address of TAR.
mrd -address-space AP1 0x80090088
Read address 0x80090088 on DAP APB-AP. 0x80090088 corresponds to DBGDSCR register of Cortex-A9#0, on Zynq AP 1 selects the APB-AP.
mrd -address-space AP0 0xe000d000
Read address 0xe000d000 on DAP AHB-AP. 0xe000d000 corresponds to QSPI device on Zynq AP 0 selects the AHB-AP.