Content-Length: 239684 | pFad | http://github.com/micropython/micropython/issues/17343

68 ports/rp2: Make `FLASH` length configurable in linker script. · Issue #17343 · micropython/micropython · GitHub
Skip to content

ports/rp2: Make FLASH length configurable in linker script. #17343

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

Closed
sfe-SparkFro opened this issue May 22, 2025 · 1 comment
Closed

ports/rp2: Make FLASH length configurable in linker script. #17343

sfe-SparkFro opened this issue May 22, 2025 · 1 comment
Labels
enhancement Feature requests, new feature implementations

Comments

@sfe-SparkFro
Copy link
Contributor

Description

Right now, the FLASH length in memmap_mp_rp2040.ld and memmap_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 by PICO_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:

-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

@dpgeorge
Copy link
Member

Fixed by 6bfb83e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, new feature implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/micropython/micropython/issues/17343

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy