diff options
| author | Nathan Perry <np@nathanperry.dev> | 2024-09-24 00:13:11 -0400 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2024-09-26 06:50:09 -0400 |
| commit | c15509282eeb620b6ce70059ea10c4657cff7474 (patch) | |
| tree | 361ab3803fdd0748565f69b5a56824ac84f2e23c /target-rp2040-rescue.cfg | |
| parent | 34f44829237f33a9940c12f57126a53f2a9c23f3 (diff) | |
pio i2s
Diffstat (limited to 'target-rp2040-rescue.cfg')
| -rw-r--r-- | target-rp2040-rescue.cfg | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/target-rp2040-rescue.cfg b/target-rp2040-rescue.cfg new file mode 100644 index 0000000..b124dda --- /dev/null +++ b/target-rp2040-rescue.cfg @@ -0,0 +1,28 @@ +source [find target/swj-dp.tcl] +source [find mem_helper.tcl] + +set _CHIPNAME rp2040 +set _CPUTAPID 0x01002927 +set _ENDIAN little + +swj_newdap $_CHIPNAME.rescue_dp cpu -dp-id $_CPUTAPID -instance-id 0xf +set _TARGETNAME_0 $_CHIPNAME.rescue +dap create $_TARGETNAME_0.dap -chain-position $_CHIPNAME.rescue_dp.cpu -ignore-syspwrupack + +# Have to init before we can do dpreg commands +init + +# The rescue debug port uses the AP CTRL/STAT bit DBGPWRUPREQ to reset the +# PSM (power on state machine) of the RP2040 with a flag set in the +# VREG_AND_POR_CHIP_RESET register. Once the reset is released +# (by clearing the DBGPWRUPREQ flag), the bootrom will run, see this flag, +# and halt. Allowing the user to load some fresh code, rather than loading +# the potentially broken code stored in flash + +# Clear DBGPWRUPREQ +$_TARGETNAME_0.dap dpreg 0x4 0x00000000 + +# Verifying CTRL/STAT is 0 +$_TARGETNAME_0.dap dpreg 0x4 + +echo "Now attach a debugger to your RP2040 and load some code" |
