Build images for RAM-only execution - #26
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #4 for details. Use the
from_ramruntime 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).