Skip to content

Commit

Permalink
Update openocd configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Feb 4, 2021
1 parent 967f5ff commit a065e21
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ gdb_memory_map enable
sam7x.cpu configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x10000 -work-area-backup 0
flash bank sam7x.flash.0 at91sam7 0 0 0 0 sam7x.cpu 0 0 0 0 0 0 0 18432
flash bank sam7x.flash.1 at91sam7 0 0 0 0 sam7x.cpu 1 0 0 0 0 0 0 18432
transport select jtag
adapter speed 1000
8 changes: 0 additions & 8 deletions tools/jtag_openocd/interface-armusbocd.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions tools/jtag_openocd/interface-busblaster.cfg

This file was deleted.

8 changes: 3 additions & 5 deletions tools/jtag_openocd/interface-buspirate.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Commands specific to the BusPirate
interface buspirate
buspirate_port /dev/ttyUSB0
adapter_khz 1000

# Communication speed
buspirate_speed normal # or fast
source [find interface/buspirate.cfg]

buspirate_port /dev/ttyUSB0

# Voltage regulator: enabled = 1 or disabled = 0
buspirate_vreg 1
Expand Down
11 changes: 1 addition & 10 deletions tools/jtag_openocd/interface-c232hm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,4 @@
# Black <> GND
# Red <> 3.3 (don't connect if C232HM-EDSL-0! power via USB instead)

interface ftdi
#ftdi_device_desc "C232HM-DDHSL-0"
#ftdi_device_desc "C232HM-EDHSL-0"
ftdi_vid_pid 0x0403 0x6014

ftdi_layout_init 0x0008 0x400b
ftdi_layout_signal LED -ndata 0x4000

transport select jtag
adapter_khz 1000
source [find interface/ftdi/c232hm.cfg]
4 changes: 0 additions & 4 deletions tools/jtag_openocd/interface-jlink.cfg

This file was deleted.

8 changes: 0 additions & 8 deletions tools/jtag_openocd/interface-jtagkey.cfg

This file was deleted.

21 changes: 1 addition & 20 deletions tools/jtag_openocd/interface-raspberrypi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,7 @@
# 6 <> GND
# 1 <> 3.3

interface bcm2835gpio

# This file is meant for first versions of Raspberry Pi
# You can check yours with:
# dd if=/proc/device-tree/soc/ranges bs=4 skip=1 count=1 2>/dev/null|xxd -p
# if it returns 20000000, you're fine
# if it returns 3F000000, use interface-raspberrypi2.cfg
bcm2835gpio_peripheral_base 0x20000000

# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
bcm2835gpio_speed_coeffs 113714 28

# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
# Header pin numbers: 23 22 19 21
bcm2835gpio_jtag_nums 11 25 10 9
source [find interface/raspberrypi-native.cfg]

bcm2835gpio_srst_num 18
reset_config srst_only srst_push_pull

transport select jtag
adapter_khz 1000
21 changes: 1 addition & 20 deletions tools/jtag_openocd/interface-raspberrypi2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,7 @@
# 6 <> GND
# 1 <> 3.3

interface bcm2835gpio

# This file is meant for recent versions of Raspberry Pi
# You can check yours with:
# dd if=/proc/device-tree/soc/ranges bs=4 skip=1 count=1 2>/dev/null|xxd -p
# if it returns 20000000, use interface-raspberrypi.cfg
# if it returns 3F000000, you're fine
bcm2835gpio_peripheral_base 0x3F000000

# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
bcm2835gpio_speed_coeffs 146203 36

# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
# Header pin numbers: 23 22 19 21
bcm2835gpio_jtag_nums 11 25 10 9
source [find interface/raspberrypi2-native.cfg]

bcm2835gpio_srst_num 18
reset_config srst_only srst_push_pull

transport select jtag
adapter_khz 1000
6 changes: 0 additions & 6 deletions tools/jtag_openocd/interface-shikra.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions tools/jtag_openocd/interface-wiggler.cfg

This file was deleted.

33 changes: 30 additions & 3 deletions tools/jtag_openocd/openocd_configuration.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
CONFIG_GEN=general.cfg
CONFIG_CHIP=chip-at91sam7s.cfg
CONFIG_BOARD=board-at91sam7s.cfg
IMAGE=../../recovery/proxmark3_recovery.bin
DUMP="dump_$(date +'%Y%m%d-%H%M%S').bin"

# Example using Segger Jlink:
CONFIG_IF=interface-jlink.cfg
# One can use openocd-provided interfaces or local interface files
# Here are a few examples

# Segger Jlink:
CONFIG_IF=interface/jlink.cfg

# Raspberry Pi models Pi1, Pi2 and Pi Zero (read interface-raspberrypi.cfg for pinout)
#CONFIG_IF=interface-raspberrypi.cfg

# Raspberry Pi models 2+ and above (read interface-raspberrypi2.cfg for pinout)
#CONFIG_IF=interface-raspberrypi2.cfg

# DP BusBlaster:
#CONFIG_IF=interface/ftdi/dp_busblaster.cfg

# BusPirate:
#CONFIG_IF=interface-buspirate.cfg

# C232HM-DDHSL-0 and C232HM-EDSL-0 (beware! read interface-c232hm.cfg instructions)
#CONFIG_IF=interface-c232hm.cfg

# Olimex ARM-USB-OCD Dongle:
#CONFIG_IF=interface/ftdi/olimex-arm-usb-ocd.cfg

# Amontec JTAGKey:
#CONFIG_IF=interface/ftdi/jtagkey.cfg

# Wiggler:
#CONFIG_IF=interface/parport.cfg
2 changes: 1 addition & 1 deletion tools/jtag_openocd/openocd_flash_dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if [ -e "$DUMP" ]; then
echo "$DUMP exists already. Abort!"
exit 1
fi
openocd -f $CONFIG_GEN -f $CONFIG_IF -f $CONFIG_CHIP -c "init;halt;dump_image $DUMP 0x100000 0x80000;exit"
openocd -f $CONFIG_GEN -f $CONFIG_IF -f $CONFIG_BOARD -c "init;halt;dump_image $DUMP 0x100000 0x80000;exit"
2 changes: 1 addition & 1 deletion tools/jtag_openocd/openocd_flash_recovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if [ ! -e "$IMAGE" ]; then
echo "$IMAGE missing. Abort!"
exit 1
fi
openocd -f $CONFIG_GEN -f $CONFIG_IF -f $CONFIG_CHIP -c "init;halt;flash erase_sector 0 0 15;flash erase_sector 1 0 15;flash write_image $IMAGE 0x100000;exit"
openocd -f $CONFIG_GEN -f $CONFIG_IF -f $CONFIG_BOARD -c "init;halt;flash erase_sector 0 0 15;flash erase_sector 1 0 15;flash write_image $IMAGE 0x100000;exit"
2 changes: 1 addition & 1 deletion tools/jtag_openocd/openocd_interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ cd $(dirname "$0")
echo "*********************************************"
echo "Connect to OpenOCD via: telnet localhost $(awk '/^telnet_port/{print$2}' $CONFIG_GEN)"
echo "*********************************************"
openocd -f $CONFIG_GEN -f $CONFIG_IF -f $CONFIG_CHIP
openocd -f $CONFIG_GEN -f $CONFIG_IF -f $CONFIG_BOARD

0 comments on commit a065e21

Please sign in to comment.