From c15509282eeb620b6ce70059ea10c4657cff7474 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Tue, 24 Sep 2024 00:13:11 -0400 Subject: pio i2s --- target-rp2040-rescue.cfg | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 target-rp2040-rescue.cfg (limited to 'target-rp2040-rescue.cfg') 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" -- cgit v1.3.1