Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How to place compiled code at a selected address in STM32 ?

Status
Not open for further replies.

kekon

Full Member level 3
Joined
Sep 19, 2002
Messages
156
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,298
Location
Poland, Białystok
Activity points
1,493
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".
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top