6.5.8.4.10 Set Program Counter

To transfer a data word to an Arm core register, special-purpose register, or Floating-point extension register, a debugger:

  • Writes the required word (PC value) to DCRDR
  • Writes to the DCRSR, with the REGSEL value indicating the required register and the REGWnR bit set to ‘1’ to indicate a write access. This write clears the DHCSR S_REGRDY bit to ‘0’.
  • If required, polls DHCSR until DHCSR.S_REGRDY reads as ‘1’. This indicates that the processor has transferred the DCRDR value to the selected register.

Reference: ARM DDI 0403E.b, C1.6.4 Debug Core Register Data Register, DCRDR

Table 6-36. Set Program Counter Sequence
Stepsrddi_dap
WriteD32(DCRDR, Program Counter Value)
WriteD32(DCRSR, (Address | REGWnR = 1))
Poll DHCSR for S_REGRDY