Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Hermann-SW / flash
Last active July 24, 2023 19:01
"Flash .uf2 file to"/reboot Raspberry Pico with baudrate switching method [+picotool reboot]
#!/bin/bash
sudo stty -F /dev/ttyACM0 1200
echo waiting
while [ ! -d /media/pi/RPI-RP2 ]; do sleep 0.1; done
sleep 0.5
if [ "$*" = "" ]; then echo rebooting; sudo picotool reboot; exit; fi
echo copying
cp $1 /media/pi/RPI-RP2
echo done