7.5.8 Set Core Register
To transfer a data word to 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 the required value to DCRDR.
- Writes to the DCRSR, with the REGSEL value indicating the required register and the REGWnR bit as
1to indicate a write 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 DCRDR value to the selected register.
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 value to DCRDR | WriteD32 (DCRDR, value) |
| Write REGSEL | WriteD32 (DCRSR, RegSel) |
| Poll DHCSR for S_REGRDY | S_REGRDY = 1 |
For more details, refer to the RegSel description in the Arch manual C1.6.4 Debug Core Register Selector Register, DCRSR.
