Skip to content

Commit

Permalink
replace openocd with openocd v0.12.0, and add new interfaces for load…
Browse files Browse the repository at this point in the history
…ing to rp2040
  • Loading branch information
CamDavidsonPilon committed Jan 8, 2024
1 parent d5e5ab2 commit bf806b1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion workspace/scripts/files/bash/load_rp2040.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@ set -e

export LC_ALL=C

openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "init" -c "reset halt" -c "load_image /usr/local/bin/main.elf" -c "resume 0x20000000" -c "exit" || true

# Check if the Raspberry Pi version is 5
RPI_MODEL=$(grep -o "Raspberry Pi 5" /proc/cpuinfo)

# Choose the correct interface based on Raspberry Pi version
if [ "$RPI_MODEL" = "Raspberry Pi 5" ]; then
INTERFACE=interface/raspberrypi-linuxgpiod-chip4.cfg
else
INTERFACE=interface/raspberrypi-linuxgpiod-chip0.cfg
fi

openocd -f $INTERFACE -f target/rp2040.cfg -c "init" -c "reset halt" -c "load_image /usr/local/bin/main.elf" -c "resume 0x20000000" -c "exit" || true
5 changes: 4 additions & 1 deletion workspace/scripts/files/config.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ samples_per_second=0.2
ir_led_intensity=50

# lower to remove heating artifacts, but may introduce more noise in the OD. Must be between 0 and 1.
pd_reference_ema=0.8
pd_reference_ema=0.9

# populate with your local AC frequency (typically 50 or 60) to get slightly reduced noise. Inferred from data otherwise.
# local_ac_hz=

# use the most recent calibration file, if available
use_calibration=1

# apply a smoothing penalizer
smoothing_penalizer=700.0

[od_config.photodiode_channel]
# Default IR photodiode channel(s) to use and its angle relative to the IR LED(s),
# OR choose the reference photodiode using the keyword REF.
Expand Down
Binary file modified workspace/scripts/files/system/openocd/openocd
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
adapter driver linuxgpiod
adapter gpio swclk 25 -chip 0
adapter gpio swdio 24 -chip 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
adapter driver linuxgpiod
adapter gpio swclk 25 -chip 4
adapter gpio swdio 24 -chip 4

0 comments on commit bf806b1

Please sign in to comment.