tscircuit/standard-jst-programmer
26 × 42 mm USB-C RP2040 programmer with JST and TC2030 IDC SWD, NRST, selectable sensed 5 V / 3.3 V power, RGB status, and importable JST SH/Tag-Connect targets. Top-side assembly.
- Version
- 0.8.0
- License
- unset
- Stars
- 0
firmware/build.sh
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "$0")/.." && pwd)"
firmware_work="$repo_root/work/firmware"
mkdir -p "$firmware_work"
if [ ! -d "$firmware_work/debugprobe/.git" ]; then
git clone https://github.com/raspberrypi/debugprobe.git "$firmware_work/debugprobe"
fi
git -C "$firmware_work/debugprobe" checkout 3fff5b240ca8200c7ad538cb61c02dfc39bda831
git -C "$firmware_work/debugprobe" submodule update --init --recursive
if [ ! -d "$firmware_work/pico-sdk/.git" ]; then
git clone https://github.com/raspberrypi/pico-sdk.git "$firmware_work/pico-sdk"
fi
git -C "$firmware_work/pico-sdk" checkout 079c6f39023649b154152db30f1d781e884879bc
git -C "$firmware_work/pico-sdk" submodule update --init --recursive
cp "$repo_root/firmware/board_standard_jst_config.h" "$firmware_work/debugprobe/include/board_standard_jst_config.h"
python3 "$repo_root/firmware/patch_upstream.py" "$firmware_work/debugprobe"
cmake -S "$firmware_work/debugprobe" -B "$firmware_work/build" \
-DPICO_SDK_PATH="$firmware_work/pico-sdk" \
-DPICO_BOARD=standard_jst_programmer \
-DPICO_BOARD_HEADER_DIRS="$repo_root/firmware" \
-DDEBUG_ON_PICO=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build "$firmware_work/build" --parallel 4
python3 "$repo_root/scripts/check-firmware-usb.py" "$firmware_work/build/debugprobe.elf"
mkdir -p "$repo_root/dist/firmware"
cp "$firmware_work/build/debugprobe.uf2" "$repo_root/dist/firmware/standard-jst-programmer.uf2"