How to specify an offset within a memory segment in a section placement file?
My solution contains two projects. I want to specify that they be loaded into different halves of Flash memory.
I have defined a memory region called FlexSPI that is 64MB in size. My memory map file looks like this:
<Root name="iMXRT" >
<MemorySegment name="FlexSPI" start="$(FlexSPISTART:0x60000000)" size="$(FlexSPISIZE:0x04000000)" access="ReadOnly"/>
... other segments ...
</Root>
My first project is a bootloader, which should be loaded into the FlexSPI region at address 0x60000000 (i.e., the beginning). My placement file for the bootloader looks like this:
<!DOCTYPE Linker_Placement_File>
<Root name="FlexSPI (QuadSPI) Section Placement">
<MemorySegment name="$(FLASH_NAME:FlexSPI)">
<ProgramSection load="Yes" name=".fill" size="$(FILLSIZE:0x0)" keep="Yes"/>
... other sections ...
</MemorySegment>
... other segments ...
</Root>
My second project is my actual app, which should be loaded into the FlexSPI region at address 0x62000000 (i.e., half-way through). I tried to avoid using hard-coded addresses and use the macros in calculations like this:
<!DOCTYPE Linker_Placement_File>
<Root name="FlexSPI (QuadSPI) Section Placement">
<MemorySegment name="$(FLASH_NAME:FlexSPI)">
<ProgramSection load="Yes" name=".fill" start="$(FlexSPISTART)+$(FlexSPISIZE)/2" size="$(FILLSIZE:0x0)" keep="Yes"/>
... other sections ...
</MemorySegment>
... other segments ...
</Root>
However, perhaps predictably, it didn't work.
What is the best way to do this?
-
Thanks Jon - I've done that now and both projects are now compiled and linked successfully. However, when trying to download the one that starts at the midpoint address 0x62000000 I get the following error:
Memory erase operation failed: no driver installed for memory range
Any ideas?
Please sign in to leave a comment.
Comments
3 comments