raspberrypi / picotool

BSD 3-Clause "New" or "Revised" License
590 stars 106 forks source link

Picotool fails to program Pico every other time, when binary type set to `no_flash` #144

Closed matsobdev closed 1 month ago

matsobdev commented 1 month ago

Having empty flash or picotool incompatible binary or picotool compatible binary and trying to:

picotool load -x "firmware.uf2" -f

results with success rate of 50%. For incompatible binary obviously Pico needs to be put into bootsel mode. Manually putting Pico into bootsel mode for compatible binary doesn't change situation for that case.

First attempt to program Pico is successfull, but second is not and message is displayed like so:

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

Despite the reboot attempt, no accessible RP2040/RP2350 devices in BOOTSEL mode were found. It is possible the device is not responding, and will have to be manually entered into BOOTSEL mode.

No bootsel drive appears, but running:

picotool load -x "firmware.uf2" -f

once again successfully programs Pico and cycle repeats. SDK 2.0.0, picotool 2.0.0. Binary type copy_to_ram works as expected, so I guess something with the presence of a binary inside flash.

PS. EEEEEEEEEEEEEEEE is an original message, not anonymisation.

lurch commented 1 month ago

PS. EEEEEEEEEEEEEEEE is an original message, not anonymisation.

Yes, probably related to https://www.raspberrypi.com/documentation/pico-sdk/high_level.html#group_pico_unique_id_1gaf87ef8a55d8dc2520776e427a605b6fb "On PICO_NO_FLASH builds the unique identifier is set to all 0xEE."

will-v-pi commented 1 month ago

Fixed in develop, by adding a special case to ignore the EEEEEEEEEEEEEEEE serial number when tracking serial numbers over a reboot