Initial commit: Pico serial echo with BOOTSEL reboot
This commit is contained in:
22
load.sh
Executable file
22
load.sh
Executable 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."
|
||||
Reference in New Issue
Block a user