7.5.7 Get Core Register
To transfer a data word from an ARM core register, special-purpose register or floating-point extension register, a debugger:
- Ensures the CPU is in the Debug state by reading DHCSR.S_HALT bit and places the CPU in the Debug state if this is not the case.
- Writes to the DCRSR with the REGSEL value indicating the required register and the REGWnR bit as
0to indicate a read access. This write clears the DHCSR.S_REGRDY bit to0. - Polls DHCSR until DHCSR.S_REGRDY reads as
1. This shows that the processor has transferred the value of the selected register to DCRDR. - Reads the required value from DCRDR.
For more details, refer to the ARMv7-M Architecture Reference Manual - ARM DDI 0403E, C1.6.3 Debug Core Register Selector Register, DCRSR.
| Steps | Commands |
|---|---|
| Write REGSEL | WriteD32 (DCRSR, RegSel) |
| Poll DHCSR for S_REGRDY | S_REGRDY = 1 |
| Read value from DCRDR | ReadD32 (DCRDR, value) |
| Register Name | CoreReg |
|---|---|
| R0 | 0 |
| R1 | 1 |
| .. | .. |
| R12 | 12 |
| SP | 13 |
| LR | 14 |
| PC | 15 |
| xPSR | 16 |
| .. | .. |
Note: For complete table details, refer to the Arch Manual C1.6.3 Debug Core Register Selector Register, DCRSR.
