End of program...
Posted on May 12, 2018 at 00:03
Dear Community,
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:
:107C00000100000000000000000000000000000073
:107C10000000000000000000000000000000000064
:107C20000000000000000000000000000000000054
:107C30000000000000000000000000000000000044
:107C40000000000000000000000000000000000034
:107C50000000000000000000000000000000000024
:107C60000000000000000000000000000000000014
:107C70000000000000000000000000000000000004
:107C800000000000000000000000000000000000F4
:107C900000000000000000000000000000000000E4
:107CA00000000000A92E0008B92D00081D2E0008B4
:107CB000F12E000800000000011200084D1200081B
:107CC000F91B000800000000010203040102030484
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:
<LINK NO LONGER ACTIVE>
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.
