Picotool load combined uf2 ignoring family ID

Open
#344 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
cli, embedded-iot

Research direction

Start at the picotool load -f combined.uf2 path and the UF2 family-ID handling, then reproduce with combined files targeting RP2040 and RP2350. Done means loading selects only the firmware blocks matching the connected device instead of using only the first family ID.

Written by the indexing model from the issue text.

Description

According to https://github.com/microsoft/uf2#family-id , the family ID is there to allow multiple uf2 files combined into one for different targets.
(and also some comments in https://github.com/raspberrypi/picotool/pull/313 )
This works well with the RP2040 bootloader, when copying the uf2 ( cp test2.uf2 /media/arendjan/RPI-RP2/ ) then my board runs the correct firmware, either first or second part of the combined uf2.

When using picotool load -f combined.uf2, I get:

Tracking device serial number E6625C48934A7E32 for reboot
The device was asked to reboot into BOOTSEL mode so the command can be executed.

WARNING: Multiple family IDs in a single UF2 file - only using first one
WARNING: Multiple family IDs in a single UF2 file - only using first one
Loading into Flash:   [==============================]  100%

The device was asked to reboot back into application mode.

and the board either boots the code (when first part of uf2 is for it) or reconnects in bootloader mode (when correct blocks are in second part).

Using family flags ( --family rp2040 ) doesn't help.

I'd assume picotool would only upload the firmware for the connected device (or the bootloader would filter it).

(picotool build from current main)

RP2350 also not working:

UF2 correct part is second one:

Tracking device serial number DA72B1529E0666F5 for reboot
The device was asked to reboot into BOOTSEL mode so the command can be executed.

WARNING: Multiple family IDs in a single UF2 file - only using first one
Family ID 'rp2040' cannot be downloaded anywhere
ERROR: This file cannot be loaded onto a device with no partition table

UF2 correct part is first one:

WARNING: Multiple family IDs in a single UF2 file - only using first one
Family ID 'rp2350-arm-s' can be downloaded in absolute space:
  00000000->02000000
WARNING: Multiple family IDs in a single UF2 file - only using first one
Loading into Flash:   [==============================]  100%
Dominant language
C++
Stars
999
Forks
189
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/picotool

All issues in raspberrypi/picotool

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.