aboutsummaryrefslogtreecommitdiff
path: root/board/build.rs
AgeCommit message (Collapse)Author
6 hoursPrototype secondary core supportHEADmainIan McIntyre
Haven't tested the included examples on hardware. It's just here so I can define an inspect_elf test. Out of tree, there's a basic example on an 1170EVK.
2026-10-27Change how board supports RAM-only programsIan McIntyre
Just a refactor inside board. Activate the "ram" feature to target a RAM-only for your given bord. I'm adding the 1170EVK RAM support.
2026-03-08Preload RAM for ECC ciphersIan McIntyre
Testing shows that we must blow fuses in order to activate either ECC engine. Once the fuse is blown, NXP's boot ROM will enable the ECC engine. So by the time the reset handler is running, ECC may already be enabled. The 32-bit copy loops won't work for initializing ITCM and OCRAM. Since these bus widths are 64-bit and the ECC is computed over 64 bits, these 32 bit accesses result in a read-modify-write (RMW) on the underlying interface. If these RAM regions aren't already initialized, we'll fail an ECC check; the read in RMW compares bogus RAM contents against a bogus ECC. This seems to dramatically slow down initialization, or stall it (I've seen the CPU spinning in the boot ROM). If we listen to NXP and use 64-bit writes to preload ECC-protected RAM regions, the 32-bit copy loops will work as expected. Note that we can still issue 64-bit accesses towards DTCM; they're scattered across the two 32-bit interfaces. There's an NXP whitepaper [1] describing that. Once TCM ECC is enabled, we need to tell the TCM interfaces to RMW smaller accesses. Otherwise, we won't generate correct ciphers. We also might need to retry operations if there was a correction by the RAM controller. We can perform these with predicated instructions. Tested on an 1010EVK, where I used the debugger to show the control registers weren't touched; and tested on the 1170EVK, with the same approach showing the expected set bits. [1]: https://www.nxp.com/docs/en/white-paper/CORTEXM7WP.pdf [2]: https://www.nxp.com/docs/en/application-note/AN13204.pdf
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.
2026-02-15Add builder config for boot_header inclusionIan McIntyre
To form a secondary image, use in_flash to position it in flash, then override the default setting that disables the boot header. With proper configuration, NXP's boot ROM can load a backup image. This commit reconfigures the 1170EVK board for the experiment.
2025-11-11Prototype API to build runtime in RAMIan McIntyre
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.
2025-03-21Added in_flash RuntimeBuilder constructorSherif A Abdou
Applications linked through this builder can be placed in a flash reservation. You'll need some other software to launch these programs, since they lack the boot header required by the NXP boot ROM.
2024-04-03Add environment variable overrides for stack, heapIan McIntyre
If you define a runtime, you can call `stack_size_env_override` to define an optional environment variable checked by the runtime builder. Same goes for the heap. A user can set these environment variables to override the runtime's stack / heap size. You can use this package's examples to try it out; see the updated build script. There's no default environment variable for either memory region. The package that defines the runtime needs to opt-in to this feature.
2022-12-01First commitIan McIntyre