Debug Test Access Port
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
14-34
ID012310
Non-Confidential, Unrestricted Access
14.8.6
Reading a current mode ARM register in the range R0-R14
Use the following sequence to read a current mode ARM register in the range R0-R14:
SCAN_N
5
; select DTR
ITRSEL
; select the ITR and EXTEST
INST
MCR p14,0,Rd,c0,c5,0
; instruction to copy Rd into CP14 debug
; register c5
RTI
INTEST
; select the DTR and INTEST
LOOP
DATA
0x00000000 Ready readData
UNTIL
Ready==1
; wait until the instruction ends
Save value in readData
Note
Register R15 cannot be read in this way because the effect of the required MCR is to take an
Undefined exception.
14.8.7
Writing a current mode ARM register in the range R0-R14
Use the following sequence to write a current mode ARM register in the range R0-R14:
SCAN_N
5
; select DTR
ITRSEL
; select the ITR and EXTEST
INST
MRC p14,0,Rd,c0,c5,0
; instruction to copy CP14 debug
; register c5 into Rd
EXTEST
; select the DTR and EXTEST
DATA
Data2Write
RTI
LOOP
DATA
0x00000000 Ready
UNTIL
Ready==1
; wait until the instruction ends
Note
Register R15 cannot be written in this way because the MRC instruction used updates the CPSR
flags rather than the PC.