Hello,
I am looking for help regarding uVision IDE and Toolchain with regards to finding the end of firmware. The specific version of the tools are: Toolchain: RealView MDK-ARM Version: 4.11 C Compiler: Armcc.Exe V4.0.0.728 Assembler: Armasm.Exe V4.0.0.728 Linker/Locator: ArmLink.Exe V4.0.0.728 Librarian: ArmAr.Exe V4.0.0.728 Hex Converter: FromElf.Exe V4.0.0.728 CPU DLL: SARMCM3.DLL V4.11 Dialog DLL: DARMSTM.DLL V1.46 Target DLL: BIN\UL2CM3.DLL V1.63 Dialog DLL: TARMSTM.DLL V1.43
CHIP: STMicroelectronics STM32F103ZE
I need to be able to know the address of the end of the firmware. There are two ways to do this with the linker. They are: (1) Use "--last=EndOfFirmware.o" in the linker command options or (2) Use the scatter file to add an entry with "+LAST". This is described here: www.keil.com/.../armlinkref_chdbjjfa.htm.
I started with the first method ("--last="), but right away I ran into a linker warning. The warning is shown below:
Build target 'MyProject' linking... .\OBJ\MyProject.axf: Warning: L6340W: options first and last are ignored for link type of scattered Program Size: Code=190484 RO-data=12800 RW-data=3800 ZI-data=53944 .\OBJ\MyProject.axf: Finished: 0 information, 1 warning and 0 error messages. FromELF: creating hex file... ".\OBJ\MyProject.axf" - 0 Error(s), 1 Warning(s).
This warning indicates that the EndOfFirmware.o is not linked at the end of the HEX file because when using a scatter file "--last" option is ignored. This makes perfect sense.
I proceeded to the second option which is the scatter file. I can see a file in my project named MyProject.sct. I have also edited this file by adding:
endoffirmware.o (+First)
to the scatter file. At this time I build (compile/link) and a new scatter file is created overwriting the one I modified.
It looks like the uVision IDE creates a new scatter file every time a build (compile/link) is performed.
How do I use the uVision IDE to give it addition data to place in the scatter file?
NOTE: EndOfFirmware.c has just one line of code that creates a constant value. The pointer to this value would give the address to end of firmware.
const int iEndOfProgramValue = 0xAABBCCDD;