Skip to main content
WB71
Associate
January 28, 2022
Question

Import ExternalLoader on STM32CubeIDE error: multiple definition

  • January 28, 2022
  • 5 replies
  • 3517 views

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)

5 replies

Tesla DeLorean
Guru
January 28, 2022

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 VenmoUp vote any posts that you find helpful, it shows what's working..
MKsen.1
Associate II
February 9, 2022

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
February 28, 2022

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
WB71Author
Associate
March 10, 2022

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.

Associate
November 23, 2024

Guys, dont forget to uncheck those before generating code; for removing static declaration from the external call functions. Those for example, refer to attached picture.

Untitled.jpg