igorpadykov wrote:
ROM bootloader knows that it boots from FlexSPI and then see that destination
memory addresses also in that range (Table 2-1. System memory map i.MXRT Reference Manual),
so it considers it as xip. If it see that destination memory addresses are in SEMC external
memories (SDRAM) then it is not xip.
then the question becomes another: how does the ROM bootloader deduce the destination memory addresses? Which fields are involved? For example, in the source code of the ROM bootloader I guess there is something like the following pseudo-code:
uint32_t dest_mem;
struct IVT ivt;
struct BOOT_DATA boot_data;
dest_mem = Get_Dest_Mem(&ivt, &boot_data);
Could you detail the Get_Dest_Mem() function in pseudo-code or words?
You said "size does not matter", but I think that in a non-XIP scenario ROM bootloader have to know how many bytes to copy to destination memory, right?
if I want XIP
how should I populate boot data fields? The start field which value should it contain? Should it contain the exact base address of the boot memory or should it just contain an address inside the flash? In this case the ROM bootloader should also know the size of the flash, right? And what about IVT's Entry field? Is it used by the ROM bootloader to calculate the destination memory or is it only used to set the PC register?
If I want non-XIP
how should I populate boot data fields? In this case, the size field is taken into account, right? In this non-XIP case the ROM bootloader makes a copy from the boot memory to the destination memory, right? Could you express this copy to me in terms of memcpy()? What parameters should I pass to this hypothetical memcpy? In this example, could you avoid using the terms "boot memory" and "destination memory"? Could you express the parameters only using the fields of the data structures? For example, boot_data.start or IVT->entry.
best regards
Max