i.MX RT dual core demos
2026-11-22
I'm adding secondary core support to imxrt-rt. There's a demo repository with a dual core blinky example for the 1170 EVK(B) boards.
The imxrt-rs project has supported the dual core 1170 parts for a few years. But up to this point, everything was expected to run on the primary Cortex-M7 core. The runtime package, imxrt-rt, didn't had a concept of a secondary core with a different memory map.
Since its first release, imxrt-rt has let users define programs that relocate themselves from flash to RAM. All we need is something to know where the vector table is placed. In the primary core's case, that something is NXP's boot ROM.
I think we can use that same approach for booting the secondary core. If the primary core can point the secondary core at its vector table in flash, then the secondary core can relocate itself to RAM or maintain XiP. We would use most of the reset handler that's already implemented for the primary core. Users would have a consistent way to define their runtime, no matter the core. Seems like it works, at least for that basic demo!
The approach isn't what's recommended by AN13264, which suggests using the primary core to copy the secondary core's program into its RAM. I figure that would work too, but I'm not sure it would be as easy to achieve as what I'm attempting. Time will tell if this is the "best" approach; I'm probably missing something.
There's limitations in this imxrt-rt prototype. I'm not sure how the cores will be able to share or split OCRAM. The draft PR ignores this problem. But as long as you can put your secondary core's entire program into its TCM, you should be able to safely use this prototype. (And I think we'll need a custom critical-section implementation to safely share memory, right?)