Skip to content

Commit

Permalink
[add] 添加raspberry-pico openocd
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaochenger authored and Rbb666 committed May 16, 2024
1 parent 64d261c commit 60c3f1a
Show file tree
Hide file tree
Showing 2,092 changed files with 108,007 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/dap.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd /d E:\OpenOCD-0.12.0\bin
pyocd.exe flash --target=unknow --erase=auto --frequency=5000 D:\RT-ThreadStudio\workspace\pico-template\Debug\rtthread.bin
Binary file added bin/ftd2xx.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions bin/interface/picoprobe.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Adapter section
adapter driver picoprobe
adapter speed 5000
Binary file added bin/libusb-1.0.dll
Binary file not shown.
Binary file added bin/openocd.exe
Binary file not shown.
54 changes: 54 additions & 0 deletions bin/target/rp2040.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
source [find target/swj-dp.tcl]
source [find mem_helper.tcl]

set _CHIPNAME rp2040
set _CPUTAPID 0x01002927
set _ENDIAN little

swj_newdap $_CHIPNAME.core0 cpu -dp-id $_CPUTAPID -instance-id 0
swj_newdap $_CHIPNAME.core1 cpu -dp-id $_CPUTAPID -instance-id 1

# NOTE target smp makes both targets act a single virtual target on one port for gdb
# (without it you should be able to debug separately on two ports)
# NOTE: "-rtos hwthread" creates a thread per core in smp mode (otherwise it is a single thread for the virtual target)

# Give OpenOCD SRAM1 (64k) to use for e.g. flash programming bounce buffers (should avoid algo stack etc)
# Don't require save/restore, because this isn't something we'd do whilst a user app is running
set _WORKSIZE 0x10000
set _WORKBASE 0x20010000

#core 0
set _TARGETNAME_0 $_CHIPNAME.core0
dap create $_TARGETNAME_0.dap -chain-position $_CHIPNAME.core0.cpu
target create $_TARGETNAME_0 cortex_m -endian $_ENDIAN -coreid 0 -dap $_TARGETNAME_0.dap -rtos hwthread
$_TARGETNAME_0 configure -work-area-phys $_WORKBASE -work-area-size $_WORKSIZE -work-area-backup 0
cortex_m reset_config sysresetreq

#core 1
set _TARGETNAME_1 $_CHIPNAME.core1
dap create $_TARGETNAME_1.dap -chain-position $_CHIPNAME.core1.cpu
target create $_TARGETNAME_1 cortex_m -endian $_ENDIAN -coreid 1 -dap $_TARGETNAME_1.dap -rtos hwthread
$_TARGETNAME_1 configure -work-area-phys $_WORKBASE -work-area-size $_WORKSIZE -work-area-backup 0
cortex_m reset_config sysresetreq

target smp $_TARGETNAME_0 $_TARGETNAME_1

set _FLASHNAME $_CHIPNAME.flash
set _FLASHSIZE 0x200000
set _FLASHBASE 0x10000000
# name driver base, size in bytes, chip_width, bus_width, target used to access
flash bank $_FLASHNAME rp2040_flash $_FLASHBASE $_FLASHSIZE 1 32 $_TARGETNAME_0

# Openocd associates a flash bank with a target (in our case a core) and
# running `openocd -c "program foo.elf"` just grabs the last selected core
# from the TCL context. Select `core0` by default so that flash probe
# succeeds. Note gdb understands there are 2 cores -- this is only for TCL.
targets rp2040.core0
targets rp2040.core1

# srst is not fitted so use SYSRESETREQ to perform a soft reset
reset_config srst_nogate

gdb_flash_program enable
gdb_memory_map enable

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions drivers/FTDI CDM v2.08.28 Certified/driver.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UniversalUsbDriver>
<UniversalDriverName>FTDI CDM</UniversalDriverName>
<PrimaryInfFile>ftdibus.inf</PrimaryInfFile>
<UniqueDriverId>com.sysprogs.ftdi</UniqueDriverId>
</UniversalUsbDriver>
</ArrayOfUniversalUsbDriver>
Loading

0 comments on commit 60c3f1a

Please sign in to comment.