Skip to content

Build images for RAM-only execution - #26

Merged
mciantyre merged 3 commits into
imxrt-rs:mainfrom
mciantyre:from-ram
Nov 22, 2025
Merged

mciantyre merged 3 commits into
imxrt-rs:mainfrom
mciantyre:from-ram

Conversation

@mciantyre

Copy link
Copy Markdown
Member

See #4 for details. Use the from_ram runtime builder constructor to define a RAM-only linker script. Since most section VMAs and LMAs are equal, the MCU skips their copy.

A RAM-only program that uses FlexRAM needs to, somehow, have those FlexRAM banks already configured. Furthermore, the layout, or assignment of FlexRAM banks to memory regions, needs to match. Even if the FlexRAM region capacities haven't changed, the MCU can fault if it changes the layout after placement.

This PR lets users specify the layout. If you match the FlexRAM layout to the MCU you're being loaded into, the pre-init configuration is effectively a no-op. (We could also skip the re-configuration entirely, but I still would like to keep this feature).

Just a proof-of-concept. The new inspect_elf test seems to show that
we're building the correct image. We need another commit in order to
help the program run in FlexRAM.
The layout, or assignment of FlexRAM banks to memory regions, is more
precise than the count. When a user specifies the count, we still apply
the same layout as we always have. But now, by default, we prefer the
fuse layout for users who have made no choice.

This commit supports RAM loading with probe-rs. After probe-rs resets
the MCU and uses the fuse FlexRAM layout, firmware can perfectly match
that layout without disrupting the data already copied into RAM by the
debugger.
@mciantyre
mciantyre merged commit c4ee315 into imxrt-rs:main Nov 22, 2025
7 checks passed
@mciantyre
mciantyre deleted the from-ram branch November 22, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant