Debug Test Access Port
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
14-36
ID012310
Non-Confidential, Unrestricted Access
14.8.10 Reading the PC
Here R0 is used as a temporary register:
1.
Move the contents of the PC to R0:
ITRSEL
; select the ITR and EXTEST
INST
MOV R0,PC
RTI
LOOP
INST 0x00000000 Ready
UNTIL
Ready==1
; wait until the instruction ends
2.
Read the contents of R0 using the standard sequence that
Reading a current mode ARM
register in the range R0-R14
on page 14-34 describes.
14.8.11 Writing the PC
Here R0 is used as a temporary register:
1.
Load R0 with the address to resume using the standard sequence that
Writing a current
mode ARM register in the range R0-R14
on page 14-34 describes. Now scan chain 5 and
EXTEST are selected.
2.
Move the contents of R0 to the PC:
ITRSEL
; select the ITR and EXTEST
INST
MOV PC,R0
RTI
LOOP
INST 0x00000000 Ready
UNTIL
Ready==1
; wait until the instruction ends
14.8.12 General notes about reading and writing memory
The word-based read and write sequences are substantially more efficient than the halfword and
byte sequences. This is because the ARM LDC and STC instructions always perform word
accesses, and this can be used for efficient access to word width memory. Halfword and byte
accesses must be done with a combination of loads or stores, and coprocessor register transfers.
This is much less efficient. When writing data, the Instruction Cache might become incoherent.
In those cases, the appropriate part of the Instruction Cache must be invalidated. In particular,
the Instruction Cache must be invalidated before setting a software breakpoint or downloading
code.
14.8.13 Reading memory as words
This sequence is optimized for a long sequential read. This sequence assumes that R0 has been
set to the address to load data from prior to running this sequence. R0 is post-incremented so
that it can be used by successive reads of memory.
1.
Load and issue the LDC instruction:
SCAN_N
5
; select DTR
ITRSEL
; select the ITR and EXTEST
INST
LDC p14,c5,[R0],#4
; load the content of the position of
; memory pointed by R0 into wDTR and
; increment R0 by 4
RTI
2.
The DTR is selected to read the data:
INTEST
; select the DTR and INTEST