so I just did some searching, and it turns out the imxrt
chips are a bit more complicated than the microcontrollers that I'm familiar with, such as nrf52840
, rp2040
, or stm32
; specifically, the memory map looks way more complex and versatile.
in the "imxrt-rs" book:
https://imxrt-rs.github.io/book/index.html
they mentioned the imxrt-rt
runtime, the documentation of which explicitly states:
Link against imxrt-link.x
, which is automatically made available on the linker search path. Do not link against link.x
from cortex-m-rt
.
I took a glimpse at the imxrt-link.x
script, and it does NOT include memory.x
.
and there's also a section on "boot headers", which I don't understand either, but I did find (probably?) the source code as a linker script
in fact, the runtime is intended to be configured by the app's build script. here's an example presented in the documentation:
// build.rs
use imxrt_rt::{FlexRamBanks, Memory};
fn main() {
RuntimeBuilder::from_flexspi(FAMILY, FLASH_SIZE)
.flexram_banks(FlexRamBanks {
ocram: 0,
dtcm: FAMILY.flexram_bank_count() / 2 + 2,
itcm: FAMILY.flexram_bank_count() / 2 - 2,
})
.text(Memory::Itcm)
.vectors(Memory::Itcm)
.rodata(Memory::Dtcm)
.data(Memory::Dtcm)
.bss(Memory::Dtcm)
.uninit(Memory::Dtcm)
.stack(Memory::Dtcm)
.stack_size(4 * 1024)
.heap(Memory::Dtcm)
.heap_size(512)
.build()
.unwrap();
}
since I don't have the hardware, nor do I have any prior experience with this chip, I can't really understand what these configurations mean.
since it needs special runtime and linker script, I'm not sure whether the code using the generic cortex-m-rt
(thus memory.x
) would work for this mcu.
I suggest you to join the imxrt-rs
chatroom (there's a link at the bottom of the "introduction" chapter of the imxrt-rs book), to chat with the people who actually have the actual hardware and the knowledge.
meanwhile, feel free to continue the discussion on this forum, though you are more likely to get generic advices that are not specific to this mcu.