We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
In a scatter file can I put a code segment (eg the vector table) in two different places in the output file even though I only defined it in the code once eg:
LR_VECTORTABLE 0x08000000 0x00000140 { ER_VECTORTABLE 0x08000000 0x00000140 { *.o (RESET, +First) ; Duplicated for stand alone builds } } LR_APP 0x08008000 0x00038000 { ER_APP 0x08008000 0x00038000 { *.o (RESET, +First) ; Duplicated for bootloader systems (bootloader system will cut off the above hex) *(InRoot$$Sections) .ANY (+RO) } RW_ALL 0x20000000 0x00010000 { .ANY (+RW +ZI) } }
NB: this does not seem to work I get a error: "Error: L6223E: Ambiguous selectors found for startup_stm32f10x_hd.o(RESET) from Exec regions ER_VECTORTABLE and ER_APP.". What I want to know is can this be done somehow ?
I never tried anything like this; but, I thing you don't need two scatter files - I _think_ you can create separate startup files, having a distinct AREA statement, like this (just above the vector table):
AREA RESET_BOOT, CODE, READONLY
and
AREA RESET, CODE, READONLY
You must of course adjust the scatter file as well.
Yeh I could do that, I was hoping not to have to duplicate code as it gets confussing but I guess this is just the limitations of the linker. I think the easiest way is going to be having to targets, one that is bootloadable and one that is standalone.
Thanks for they help.