Skip to content

Make universal blink example work with W boards#746

Open
will-v-pi wants to merge 4 commits intodevelopfrom
universal-w-blink
Open

Make universal blink example work with W boards#746
will-v-pi wants to merge 4 commits intodevelopfrom
universal-w-blink

Conversation

@will-v-pi
Copy link
Copy Markdown
Contributor

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

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
@lurch
Copy link
Copy Markdown
Contributor

lurch commented Mar 23, 2026

I guess the universal.h is only designed to run on the official Raspberry Pi microcontroller boards (Pico, Pico W, Pico WH, Pico 2, Pico 2 W) rather than on any 3rd-party RP2040 or RP2350 boards, so perhaps it ought to be named something like pico_universal.h ?

@will-v-pi
Copy link
Copy Markdown
Contributor Author

I guess the universal.h is only designed to run on the official Raspberry Pi microcontroller boards (Pico, Pico W, Pico WH, Pico 2, Pico 2 W) rather than on any 3rd-party RP2040 or RP2350 boards, so perhaps it ought to be named something like pico_universal.h ?

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)

@lurch
Copy link
Copy Markdown
Contributor

lurch commented Mar 23, 2026

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!

@peterharperuk
Copy link
Copy Markdown
Contributor

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
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

@will-v-pi
Copy link
Copy Markdown
Contributor Author

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
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

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

@peterharperuk
Copy link
Copy Markdown
Contributor

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
peterharperuk
peterharperuk previously approved these changes Mar 25, 2026
Co-authored-by: Andrew Scheller <lurch@durge.org>
Co-authored-by: will-v-pi <108662275+will-v-pi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants