aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
AgeCommit message (Collapse)Author
2026-10-27Preload RAM sections, maybe, if ECC RAM is activeIan McIntyre
Blasting all of RAM with zeros would wipe ourselves away if we were executing from RAM. It also wipes out the HAB event log, which seems to reside in the boot ROM reservation. We now zero individual memory regions. Similar to the copy loops, we'll skip the loop if the VMA and LMA are equal. It looks silly to zero things like bss when we know cortex-m's reset handler will do it; but, the usual loop doesn't use the 64 bit writes we'd need to preload ciphers in ITCM and OCRAM. Tested RAM loading with probe-rs, using an 1170EVK w/ ECC RAM active.
2026-03-08Restrict RAM if ECC is enabledIan McIntyre
As of this commit, the RuntimeBuilder only limits the available OCRAM if either ECC controller is enabled. It's misleading; however, it gives users a chance to evaluate their firmware builds with the restricted RAM regions. I'll add and test the controller setups in a later commit. Existing tests still pass. New unit tests demonstrate the restricted RAM behavior.
2026-03-08Add section for boot ROM reservationsIan McIntyre
The boot ROM is allowed to use allocations of OCRAM as scratch space. If you interact with the boot ROM -- using it to interact with FlexSPI, for instance -- then you cannot also use these OCRAM regions. See the system boot chapter in the reference manual for more info. The boot ROM typically reserves the start of OCRAM. The size varies by chip. This commit describes a new section, .bootrom_reservation, at the start of OCRAM. Users are encouraged to place a MaybeUninit buffer that's sized for your ROM's requirements. If users don't place anything in this section, then the new directive is a no-op. On the other hand, the section is defined before other RAM regions, so that it takes precedence over other sections users might want to place in OCRAM. Tested using the runtime's test suite. I'm testing with the Teensy 4 binary, since the test suite can support features in this build. The updated test suite shows that the linker will place the boot ROM reservation before placing the stack, suggesting that we're respecting section priority.
2025-11-22Add builder API for FlexRAM bank layoutIan McIntyre
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.
2025-02-22Document workaround for registering exceptionsIan McIntyre
Given the way this package abuses cortex-m-rt, it's not immediately obvious how to register a Cortex-M exception handler with the `#[exception]` macro. This commit documents and demonstrates the workaround I use.
2025-02-08Add imxrt1160 target supportIan McIntyre
Implemented by following the reference manual, and tested on an MIMXRT1160EVK. The target adopts all of the same limitations as the 1170 target.
2022-12-01Update to cmrt 0.7.2, and use new featuresIan McIntyre
No need for us to set VTOR and the stack pointer anymore.
2022-12-01First commitIan McIntyre