Skip to content

Commit

Permalink
Modify raspberrypi-swd.cfg to work with pi5 too
Browse files Browse the repository at this point in the history
Signed-off-by: William Vinnicombe <[email protected]>
  • Loading branch information
will-v-pi committed Mar 27, 2024
1 parent d01e762 commit 2b78202
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions scripts/raspberrypi-swd.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
source [find interface/raspberrypi-native.cfg]
proc read_file { name } {
if {[catch {open $name r} fd]} {
return ""
}
set result [read $fd]
close $fd
return $result
}

adapter gpio swdio -chip 0 24
adapter gpio swclk -chip 0 25
set compat [read_file /proc/device-tree/compatible]

adapter speed 5000
if {[string match *bcm2712* $compat]} {
adapter driver linuxgpiod

adapter gpio swdio -chip 4 24
adapter gpio swclk -chip 4 25
} else {
source [find interface/raspberrypi-native.cfg]

adapter gpio swdio -chip 0 24
adapter gpio swclk -chip 0 25

adapter speed 5000
}

0 comments on commit 2b78202

Please sign in to comment.