Add Wi-Fi firmware partition support for Pico 2 W #1969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the ability to store and load the Wi-Fi firmware for Pico 2 W in a partition. It can be enabled by adding
pico_use_partition_firmware(<exe_name>)
to your CMakeLists.txt, which will embed a compatible partition table in the binary, and output lots of firmware UF2s to use (all called<exe_name>_firmware_..._.uf2
, eg..._firmware_w
for Wi-Fi only,..._firmware_wb
for Wi-Fi and Bluetooth,..._firmware_w_tbyb
for TBYB). You can also create your own partition table and use that.A Wi-Fi firmware partition is detected as having the ID
0x123456789abcdef0
, and the UF2 family_is for Wi-Fi firmware blobs is0x12345678
- these should probably both be changed to something else before merging? The default firmware partition starts at 3500K into the flash - should this be changed to depend on PICO_FLASH_SIZE_BYTES? The default firmware partition is also duplicated with A/B partitions in the same location in flash - this is required to ensure a signature check is performed before loading the Wi-Fi firmware, as there's no way to call the bootrom to check the signature of a single partition (unless chaining into it), you can only callpick_ab_partition
.The Wi-Fi firmware blob is marked in it's image_def as an RP2350 Risc-V executable, and the partition is marked as
ignored_during_riscv_boot
- this ensures that it can work with TBYB (as TBYB only works for executable image_defs), and that signature checks are performed before loading the firmware when Secure Boot is enabled (because signature checks are performed for all executable image_defs in a partition that is not markedignored_during_arm_boot
). This is slightly clunky, but seems to work robustly.Supercedes #1850, as it now includes that function in this PR, and shows a use for it.