Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.2k
Description
Description
Right now, theFLASH
length inmemmap_mp_rp2040.ld
andmemmap_mp_rp2350.ld
are hard-coded to the flash size of the Pico (2MB) and Pico 2 (4MB) respectively.
FLASH(rx) :ORIGIN = 0x10000000,LENGTH = 2048k |
FLASH(rx) :ORIGIN = 0x10000000,LENGTH = 4096k |
However, there are a number of RP2 boards the have different amounts of flash. For example, all of our (SparkFun) RP2 boards have 16MB of flash. This feature request is to enable a method for the flash size in the linker script to be configurable, ideally matching whatever is set byPICO_FLASH_SIZE_BYTES
.
While these hard-coded values are fine for base MicroPython, we're working on a project (can't say what 🤫) that results in the firmware being over 2MB, possibly even over 4MB. This results in the linker failing because the firmware size exceeds the hard-coded flash length values:
firmware.elf section `.text' will not fit in region `FLASH'`region `FLASH' overflowed by xxxx bytes
Code Size
This should have no effect on the code size, other than enabling larger projects to actually fit into boards with larger flash chips. And this will ensure the flash size matches what is actually on each board.
I believe it should be trivial to define a symbol for the linker script, similar to__micropy_c_heap_size__
for example:
micropython/ports/rp2/CMakeLists.txt
Line 527 in49f81d5
-Wl,--defsym=__micropy_c_heap_size__=${MICROPY_C_HEAP_SIZE} |
Implementation
I intend to implement this feature and would submit a Pull Request if desirable
Code of Conduct
Yes, I agree