Scatter file issue - does RESET have to be located at the base flash address?
I'm somewhat new to scatter files and I'm trying to understand them better by doing some tests on a ST32F765 project (with 2mb flash at 0x0800 0000 - 0x081F FFFF).
This scatter file works OK:
LR_IROM2 0x08100000 0x00100000 { ; load region size_region (Sector 8 - Sector 11, single bank)
ER_IROM2 0x08100000 0x00100000 { ; load address = execution address
AppFileInfo.o (+RO) ;
}
}
LR_IROM1 0x08000000 0x00100000 { ; load region size_region (Sector 0 - Sector 7, single bank)
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM2 0x20000000 0x00020000 { ; RW data
.ANY (+RW +ZI)
}
}but this scatter file does not work:
LR_IROM2 0x08000000 0x00100000 { ; load region size_region (Sector 0 - Sector 7, single bank)
ER_IROM2 0x08000000 0x00100000 { ; load address = execution address
AppFileInfo.o (+RO) ;
}
}
LR_IROM1 0x08100000 0x00100000 { ; load region size_region (Sector 8 - Sector 11, single bank)
ER_IROM1 0x08100000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM2 0x20000000 0x00020000 { ; RW data
.ANY (+RW +ZI)
}
}When I try the second scatter file, everything compiles/links ok and looks like I'd expect in the .MAP file, but my debugger has warnings about the T-bit of XPSR (a Cortex core register?) being 0 and won't let me reset/run.
If I simplify things further by eliminating the LR_IROM2 block in both scatter files above, I get the same result. It's OK to have the things starting at 0x0800 0000 but not at 0x0810 0000 for some reason...
It seems like something wants/needs the RESET vector to be pointed at 0x0800 0000? Can anyone help me understand rules for this - or additional settings/configuration to adjust?