Last active
January 7, 2022 22:32
-
-
Save Hermann-SW/8a9b4280d733930b808785de58902e9d to your computer and use it in GitHub Desktop.
load a file to topmost flash location of Raspberry Pico, appended with 4-byte length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
len=`wc --bytes $1 | cut -f1 -d\ ` | |
hex=`printf "%08x" $len` | |
ofs=$(((256+2)*1024*1024-4-len)) | |
ofshex=`printf "%08x" $ofs` | |
cp $1 /tmp/picoload.bin | |
printf "\x${hex:6:2}\x${hex:4:2}\x${hex:2:2}\x${hex:0:2}" >> /tmp/picoload.bin | |
sudo picotool load /tmp/picoload.bin -o $ofshex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.raspberrypi.org/forums/viewtopic.php?f=145&t=300146