picotool icon indicating copy to clipboard operation
picotool copied to clipboard

picotool uf2 convert cannot append arbitrary data

Open Athorus opened this issue 1 year ago • 4 comments

I’ve got 2 data files : table.bin (283 bytes) configuration.bin (64 bytes)

if I do picotool uf2 convert -o 0x10001000 table.bin pico.uf2 picotool uf2 convert -o 0x10002000 configuration.bin pico.uf2 then I got : a file pico.uf2 of 512 bytes long. It means table.bin has been removed from pico.uf2 (or pico.uf2 has been deleted before adding configuration.bin)

Thanks to picotool uf2 convert we should be able to add arbitrary data at arbitrary location.

I do not have this issue when I append binary codes compiled for the right location.

Athorus avatar Nov 08 '24 09:11 Athorus

I was able to do the work with uf2conv.py tool from Sming (https://sming.readthedocs.io/en/stable/_inc/Sming/Arch/Rp2040/Components/uf2/uf2conv.html) Would be great to do it with picotool uf2 convert

Athorus avatar Nov 08 '24 11:11 Athorus

The picotool uf2 convert command does not append data to the uf2 file - it just creates a new UF2 file with the data you give it. Hence overwriting the pico.uf2 file when you run the command a second time.

We could maybe add a picotool uf2 combine command to combine 2 UF2 files into one, but that wouldn't be a priority as you can just make 2 UF2 files then copy them one at a time.

will-v-pi avatar Nov 08 '24 12:11 will-v-pi

You cannot concatenate uf2 files as they contain sequential numbers. Moreover, each time you copy an uf2 file to your pico, it reboots. For my personnal case, it doesn’t matter as I’ve found another tool. I let you choose your priorities. ;)

Athorus avatar Nov 08 '24 13:11 Athorus

I guess this is a similar request to https://github.com/raspberrypi/pico-sdk/issues/1071 and https://github.com/raspberrypi/pico-sdk/issues/1300

lurch avatar Nov 11 '24 10:11 lurch