6.5.8.4.11 Get Stack Pointer
To transfer a data word from an Arm core register, special-purpose register, or Floating-point extension register, a debugger:
- Writes to the DCRSR, with the REGSEL value indicating the required register and the REGWnR bit set to ‘
0’ to indicate a read access. This write clears the DHCSR.S_REGRDY bit to ‘0’. - Polls DHCSR until DHCSR.S_REGRDY reads as ‘
1’. This indicates that the processor has transferred the value of the selected register to DCRDR. - Reads the required value from DCRDR
Reference: ARM DDI 0403E.b, C1.6.4 Debug Core Register Data Register, DCRDR
| Steps | rddi_dap |
|---|---|
WriteD32(DCRSR, COREREG.R13) | |
| Poll DHCSR for S_REGRDY | |
ReadD32(DCRDR, value) |
Note: This sequence is similar to the Get Program Counter sequence, but it involves accessing a different register.
