Make universal blink example work with W boards#746
Conversation
Detects between W and non-W boards using the ADC, as described in "Connecting to the Internet with Raspberry Pi Pico W-series" This method should work for all boards powered from VSYS, which should cover all standard use cases for the blink example
Halves the size of the UF2 file, and halves the size in flash
|
I guess the |
It does run on quite a few 3rd-party boards - as long as they use the same LED and VSYS pins it will work (which applies to most of the boards on my desk) |
Oh, neat! |
|
Could we add an example partition json for this? And maybe a readme for how to run the universal examples on a blank Pico 2 board? peterh@rpi5-peterh-dev2:~ $ picotool load blink_universal.uf2 |
This doesn't use partitions - the error you're getting is because when picotool sees two UF2s concatenated (which is what a universal UF2 is), it only uses the first file, which is the RP2040 one. That could be fixed, but this is an existing issue for all universal UF2s. These universal UF2s are designed for drag & drop instead |
Ok, understood. It does work if you drag and drop. Maybe we should say this in the readme. |
Also switch to board_type instead of is_w so the functions are clearer
Co-authored-by: Andrew Scheller <lurch@durge.org> Co-authored-by: will-v-pi <108662275+will-v-pi@users.noreply.github.com>
peterharperuk
left a comment
There was a problem hiding this comment.
It works. I seem to be getting an interesting copy error from windows (I don't remember getting this before?) with pico1 devices , presumably because the device has rebooted before the whole uf2 has been written? It still works despite this although it's a bit disconcerting.
Yes, I get that too - I think it doesn't occur for the smaller universal binaries because the device doesn't disappear until after Windows thinks it's loaded the whole file, but this one is larger so you get this error when the device disappears |
Put last RP2040 UF2 block at the end of the file, so the transfer doesn't complete before the RP2350 UF2 has been fully copied (and ignored)
|
@peterharperuk I think I've fixed it with that latest commit - it now puts the last RP2040 UF2 block at the end of the file, so the RP2040 doesn't reboot until it has the whole file The fix is gated to only run when compiling on Unix-like OSes, as it requires |
This detects between W and non-W boards using the ADC, as described in "Connecting to the Internet with Raspberry Pi Pico W-series"
This method should work for all boards powered from VSYS, which should cover all standard use cases for the blink example
This does increase the UF2 file size from 96KB to 1,023KB, as the combined UF2 contains 2 copies of the wifi firmware, but in flash it is still only half that size