cancel
Showing results for 
Search instead for 
Did you mean: 

Import ExternalLoader on STM32CubeIDE error: multiple definition

WB71
Associate

I want to create my own external loader for STM32U585. So I start with importing IS61WV51216BLL_STM3210E-EVAL (TrueStudio) to STM32CubeIDE. Tis works in principle, but when linking the project I get the error:

update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: Loader/Dev_Inf.o:(.rodata+0x0): multiple definition of `StorageInfo'; ./Loader/Dev_Inf.o:(.rodata+0x0): first defined here

When I comment the line " KEEP(Loader/Dev_Inf.o ( .rodata ))" in stm32_flash.ld file everything compiles fine, but header with storage info is missing in elf file (*.stldr)

4 REPLIES 4

You need KEEP as there's no internal reference to the structure.

The Linkers complaining you've defined it TWICE, or more, figure out why that's happening, for example you've defined it in a .H file and included that in multiple places. Don't define/allocate things in Include files...​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MKsen.1
Associate II

The same thing happened to me. The project was working fine with IDE 1.6.0, but after updating it to 1.8.0 it does not work anymore. I am still figuring it out why.

MArri.1
Associate II

Hello, I have had the same problem, working with 1.5.0, but no more working with 1.8.0.

Have you found something to make this work again?

Thanks,

Marco

WB71
Associate

Yes, I use this linker script.

https://github.com/cturvey/stm32extldr/blob/main/ExternalLoader.ld

But unfortunately external loaders only work with ST-LINK, not with USB bootloader.

So now I write my own bootloader.