If I compile a project for e.g. STM32F051 which contains following line
int END_ofProg __attribute__((at(0x08007C00))) = 1; supposed to show up at the end of program, then I notice that Keils’ compiler adds some additional stuff on top of the hex dump:
If I remove this additional code later on e.g. by deleting the associated flash page the code stops to work after reset. If I look for the map file the code inside the hex dump should not to be there.
0x08006868 0x00000008 Data RW 61 .ARM.__AT_0x08006868 main.o
0x08006870 0x00001390 PAD
0x08007c00 0x00000004 Data RW 62 .ARM.__AT_0x08007C00 main.o **
** this is the last line.
After searching the ST Forum regarding this this issue Ive found this Thread: https://community.st.com/message/3170
However I not really understand what the mentioned change of the scatter file really does and if a changed scatter file will cause that the additional code vanishes. I would be glad if someone would post a more descriptive explanation of what is going on.