Initial commit: Pico serial echo with BOOTSEL reboot

This commit is contained in:
Ian Gulliver
2026-04-02 22:15:10 +09:00
commit 3a9dc78a5b
5 changed files with 181 additions and 0 deletions

22
load.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -e
BUILDDIR="$(dirname "$0")/build"
echo "Building..."
make -C "$BUILDDIR"
DEV=$(ls /dev/cu.usbmodem* 2>/dev/null | head -1)
if [ -n "$DEV" ]; then
echo "Sending 'b' to $DEV to enter BOOTSEL mode..."
printf 'b' > "$DEV"
sleep 2
fi
echo "Loading firmware..."
picotool load -f "$BUILDDIR/picomap.uf2"
echo "Rebooting..."
picotool reboot || true
echo "Done."