Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Labels
enhancementFeature requests, new feature implementations
@sfe-SparkFro

Description

@sfe-SparkFro

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:

-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp