-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ports/rp2: Make linker script configurable. #17029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Since we've had variant functionality merged since, I think this probably represents a good first step toward #8761 and, specifically, configuring flash sizes via the linker script so that Filesystem/Flash overlaps can be caught at compile time. The blocker with flash/app sizes was an incompatibility with
|
Code size report:
|
The more I think about this the more I think it would be ideal to get back some of what was discussed/proposed in #8761 - I need to delve into |
ports/rp2/CMakeLists.txt
Outdated
endif() | ||
endif() | ||
|
||
if (MICROPY_BOARD_LINKER_SCRIPT AND PICO_ON_DEVICE AND NOT PICO_NO_FLASH AND NOT PICO_COPY_TO_RAM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the check for MICROPY_BOARD_LINKER_SCRIPT
is needed here, it should always be valid (the above if-block makes sure of that) and we'll get an error if there's something other than RP2040 or RP2350.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof. Agreed!
This looks fine to me, a very easy way to make the linker script configurable.
That PR does have some good bits in it. It's just really complicated and touches lots of things and so requires lots of review and decision making 😅 |
Add MICROPY_BOARD_LINKER_SCRIPT to specify a custom linker script for RP2 boards/variants. This may, for example, include a PSRAM region so that C buffers or otherwise can be allocated into PSRAM. Signed-off-by: Phil Howard <github@gadgetoid.com>
a1a6916
to
8812411
Compare
Rebased and merged in c16a4db |
Add MICROPY_BOARD_LINKER_SCRIPT to specify a custom linker script for RP2 boards/variants.
This may, for example, include a PSRAM region so that C buffers or otherwise can be allocated into PSRAM.
Summary
This is a much leaner version of #8761, but broadly attempts to accomplish some of the same things.
I use this feature (with some small modifications to the PSRAM code shown here: pimoroni@79d7cc2) for building Presto with some non-critical C buffers moved to PSRAM so we can fit a large framebuffer in SRAM and use the remaining PSRAM for GC heap.
This change reflects #17028 and aims to bring some edge feature which don't cause too much immediate upset to the MicroPython codebase, but which are useful to those of us pushing weird and experimental things into shipping products 😆
Testing
Currently a critical part of the Presto build process.
Trade-offs and Alternatives
As with #17028 it seems reasonable to make linker scripts configurable, however: