Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Last active July 24, 2023 19:01
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hermann-SW/ca07f46b7f9456de41f0956d81de01a7 to your computer and use it in GitHub Desktop.
Save Hermann-SW/ca07f46b7f9456de41f0956d81de01a7 to your computer and use it in GitHub Desktop.
"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
@Hermann-SW
Copy link
Author

Hermann-SW commented Feb 8, 2021

Updated flash tool allows to flash .uf2 files as well as to reboot the Pico over USB. No change needed anywhere, besides using new V1.1.0 SDK. Projects not using USB can add single command to CMakeLists.txt to work (as hello_serial.c in animation):
https://www.raspberrypi.org/forums/viewtopic.php?f=145&t=305458&p=1833379#p1833379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment