Skip to content

rp2: use board headers from pico-sdk where possible, and fix filesystem size for variants#19270

Open
dpgeorge wants to merge 9 commits into
micropython:masterfrom
dpgeorge:rp2-use-board-headers-from-pico-sdk
Open

rp2: use board headers from pico-sdk where possible, and fix filesystem size for variants#19270
dpgeorge wants to merge 9 commits into
micropython:masterfrom
dpgeorge:rp2-use-board-headers-from-pico-sdk

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

Summary

Three changes/fixes in this PR:

  • Require boards to define PICO_FLASH_SIZE_BYTES instead of having a default fallback value. This change picked up a few bugs in boards that didn't define this value and were getting the default.
  • A lot of boards that had custom header files have now been added to pico-sdk, so we can remove the custom headers and use the pico-sdk provided ones. That simplifies things and fixes a few bugs with board configs.
  • Fix filesystem size for some board variants (bug introduced by rp2: Add linker FLASH_FS memory region to detect firmware and filesystem overlap #19225).

Testing

Built all boards and all board variants, and manually checked the "Memory region" output. The FLASH and FLASH_FS regions now have the correct sizes.

I didn't test any firmware on boards because I don't have any of the boards that needed changing/fixing.

Generative AI

I did not use generative AI tools when creating this PR.

dpgeorge added 9 commits May 27, 2026 12:08
Fixes:
- Flash size is 4MB instead of 2MB.
- The default I2C instance is now instance 1 instead of 0.

Signed-off-by: Damien George <damien@micropython.org>
Fixes:
- Flash size is 16MB instead of 4MB.
- Now supports RP2350 A2.

Signed-off-by: Damien George <damien@micropython.org>
Fixes:
- Flash size is now correct for the given variant.
- Filesystem size is adjusted per variant to leave 1MB for application.

Signed-off-by: Damien George <damien@micropython.org>
It needs to be defined at the cmake level for the linker scripts.

Signed-off-by: Damien George <damien@micropython.org>
It needs to be defined at the cmake level for the linker scripts.

Signed-off-by: Damien George <damien@micropython.org>
Fixes the FLASH_16M variant to have 15MB of filesystem space.

Signed-off-by: Damien George <damien@micropython.org>
Fixes the FLASH_8M variant to have 7MB of filesystem space.

Signed-off-by: Damien George <damien@micropython.org>
Fixes the FLASH_16M variant to have 15MB of filesystem space.

Signed-off-by: Damien George <damien@micropython.org>
This was previously a convenience, to have a default flash size.  But that
leads to more problems than not, eg when the board doesn't use the
`pico_cmake_set_default = ...` definition correctly and the flash size is
not defined.  Then the filesystem gets the incorrect size.

So, just require this symbol to be defined at the cmake level.

Signed-off-by: Damien George <damien@micropython.org>
@github-actions
Copy link
Copy Markdown

Code size report:

Reference:  rp2/boards/ADAFRUIT_FEATHER_RP2350: Add board definition. [bb9b8fc]
Comparison: rp2/CMakeLists.txt: Require boards to define PICO_FLASH_SIZE_BYTES. [merge of 5a31e47]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant