Skip to content

Commit

Permalink
swd: Add debug screipt for GDB, and openocd command line
Browse files Browse the repository at this point in the history
  • Loading branch information
keirf committed Oct 1, 2024
1 parent aebc91c commit 5f7684a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 00-README-DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Run OpenCD:
~/install/bin/openocd -s ~/install/share/openocd/scripts/ -f interface/cmsis-dap.cfg -f target/at32f4xx.cfg

In another window, run GDB (note elf image name is hardcoded in the script):
gdb-multiarch -x scripts/gdb-commands

Telnet commands:
telnet localhost 4444
mdb 0x1fffc000 512 # Read USD on 435
mdb 0x1ffff800 512 # Read USD on 415
at32f4xx mass_erase
at32f4xx usd_erase # NB. Enables RDP!
at32f4xx usd_write 0 0xa5 # Disable RDP
flash write_image [erase] flashfloppy/out/at32f435/debug/floppy/target.hex
reset run|halt|init
6 changes: 6 additions & 0 deletions scripts/gdb-commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
file /home/keir/flashfloppy/out/at32f435/debug/floppy/target.elf
target extended-remote localhost:3333
# Reset the target and call its init script
monitor reset init
# Halt the target. The init script should halt the target, but just in case
monitor halt

0 comments on commit 5f7684a

Please sign in to comment.