6.5.8.4.8 Get Program Status Register (PSR)

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

Table 6-34. Get PSR Sequence
Stepsrddi_dap
WriteD32(DCRSR, COREREG.R16)
Poll DHCSR for S_REGRDY
ReadD32(DCRDR, value)