rp2: Bump to SDK 2.3.0, port to include based linker scripts, fix silent ROMFS overflow#19415
Open
Gadgetoid wants to merge 3 commits into
Open
rp2: Bump to SDK 2.3.0, port to include based linker scripts, fix silent ROMFS overflow#19415Gadgetoid wants to merge 3 commits into
Gadgetoid wants to merge 3 commits into
Conversation
Required by the include-based linker script support that follows. Signed-off-by: Phil Howard <github@gadgetoid.com>
Pico SDK 2.3.0 makes its default linker script overridable via includes, so the port no longer needs to carry a full copy. Replace the monolithic memmap_mp_rp2040.ld and memmap_mp_rp2350.ld with memmap_mp_rp2.ld, which includes the SDK default, plus small override fragments under memmap_rp2/, memmap_rp2040/ and memmap_rp2350/ that supply only the MicroPython parts: the FLASH/FLASH_FS split, moving gc/vm/parse into RAM, and the GC heap and stack layout. Memory region boundaries are unchanged. Co-authored-by: Phil Howard <github@gadgetoid.com> Signed-off-by: Phil Howard <github@gadgetoid.com>
ROMFS is carved off the top of the code space (just below the user filesystem) by rp2_flash.c, but the FLASH region only excluded the filesystem, so the application region overlapped ROMFS. A firmware that grew into ROMFS was not caught by the linker, only by a debug-only runtime assert. Add MICROPY_HW_ROMFS_BYTES as a CMake variable, feeding both a linker defsym and a compile definition from one source, and give ROMFS its own FLASH_ROMFS region so the FLASH application region excludes it. The linker now fails at build time if the firmware overlaps ROMFS. With the default of 0 bytes the layout is unchanged. Signed-off-by: Phil Howard <github@gadgetoid.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19415 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 177 177
Lines 22927 22927
=======================================
Hits 22586 22586
Misses 341 341 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
Contributor
Author
|
🤔 I think that's the implicit bugfix kicking in. |
This was referenced Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces: #19251
Summary
This PR does three things:
Testing
TBC
Trade-offs and Alternatives
We probably lose some visibility about The Big Picture by swapping very explicit downstream linker scripts with these piecemeal ones, but I think we should defer to Pico SDK when possible.
Generative AI
I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above.