I need to place some compiled source code files at a given address in STM32F103 flash memory. I know this can be made in the linker script. I use Ride7 environment. I could't find any default linker script so I created one by extracting linker commands from automatically generated *.ld files. However, when i try to instruct linker to place some compiled files (with *.o) extension at a given address i get error messages. How can i solve the problem ?
In the section memory i declared "RECORDER SECTION":
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 20K
RECORDER (rx) : ORIGIN = 0x8005000, LENGTH = 44K
FLASHPATCH (r) : ORIGIN = 0x00000000, LENGTH = 0
ENDFLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
}
Then, i want the "main_loop.o" file to be placed at 0x8005000 address:
. = 0x8005000;
recorder_files :
{
main_loop.o(.recorder_files)
} > RECORDER AT > RECORDER
However, i get error message during compilation such as "multiple definition of `InitRTC'" ("InitRTC" is the name of a function in my program) or "main_loop.c:8: first defined here".