Hi,
i wrote a little (my first) ARM Assembler Program to copy a Bootloader to RAM and execute it there.
The Bootloader is placed like a data Array directly behind the Assembler Program by using external tools.
To copy this BL to RAM i Need the first Adress of the appended Bootloader or the total size of my Binary.
I tried a Label at the End, but the Compiler places ROM-constants behind this code so it seems not to be reliable.
Actually, i compiled it, looked the Size in the Debugger and corrected it in the Code.
Is there a possibility to get the size through a placeholder, like the Build Date f.i.?
Controller: STM32F103RB, Keil uVision 5
Here is the Code:
EXPORT Reset_HandlerReset_Handler LDR R4,=0x0800002C ; Application Array starting address
LDR R6,=0x00003FD4 ; Application Array len until 0x08004000 - 0x0800002C LDR R5,=0x20000000 ; Destination starting addressCopyFlashToSRAMLoop
LDR R0, [R4], #4 STR R0, [R5], #4 SUBS R6, #4 BNE CopyFlashToSRAMLoop LDR R0,=0x20000101;endOfBL BX R0 ; this branch to C startup code END
I am not sure if Image$$RO$$Limit is the right one for you.
Image$$RO$$Limit
infocenter.arm.com/.../pge1362065957713.html
Thank you very much, it took a while to find the correct Syntax, but now it gives the same Result!
IMPORT |Image$$RO$$Limit|
.
LDR R4, =|Image$$RO$$Limit|