cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE 2.1.0: system_stm32wl3x.o dangerous relocation: unsupported relocation

RWalko
Associate III

I have created a project for the STM32WL33 several weeks ago, using the DEEPSTOP mode with context restoration provided by ST. Even if there are some pitfalls with this the project worked mostly fine. But after the update to STM32CubeIDE 2.1.0 I get a compilation error:

./System/Startup/cpu_context_switch.o(CPUcontextRestore): Unknown destination type (ARM/Thumb) in ./Core/Src/system_stm32wl3x.o
dangerous relocation: unsupported relocation
make: *** [makefile:89: Euris3-EHKV-WMBus.elf] Error 1

I've reverted the version to 2.0.0 and the error is gone.

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Super User

@RWalko wrote:

system_stm32wl3x.o
dangerous relocation: unsupported relocation


Same message here: Solved: system_stm32wb0x.c - dangerous relocation: unsupported relocation (CubeIDE, CubeMX).

 

@Ghofrane GSOURI - Internal Ticked 228023 raised by @Mahmoud Ben Romdhane

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

10 REPLIES 10
Ghofrane GSOURI
ST Employee

Hello @RWalko 

Could you please provide your project?

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Sorry, I cannot provide my project as it includes company code and I cannot quickly clean it up. If you can provide a safe data transfer possibility I may be able to send you the project.

Andrew Neil
Super User

@RWalko wrote:

system_stm32wl3x.o
dangerous relocation: unsupported relocation


Same message here: Solved: system_stm32wb0x.c - dangerous relocation: unsupported relocation (CubeIDE, CubeMX).

 

@Ghofrane GSOURI - Internal Ticked 228023 raised by @Mahmoud Ben Romdhane

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
gbm
Principal

That's simply a new wording for an old linker error message "undefined symbol". Some strange update happened to LD.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Andrew Neil
Super User

From the ARM forums:

"Since binutils version 2.44, functions in assembly must include the assembler directive .type name, %function, otherwise they fail at linking."

binutils 2.44 and GCC 15.1.0 - dangerous relocation: unsupported relocation error when trying to build U-Boot.

 

See also: https://gcc.gnu.org/pipermail/gcc-help/2025-May/144189.html

And: https://lists.denx.de/pipermail/u-boot/2025-May/589101.html 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@gbm wrote:

That's simply a new wording for an old linker error message "undefined symbol". 


Seems to be slightly different ?

The problem seems to the that the Assembler and/or Linker has become more picky about the specific details of the definition - the definition does exist, but is not qualified with this new %function directive requirement ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User

@Ghofrane GSOURI @Mahmoud Ben Romdhane 

Another example of the same issue has just appeared - this time with H7 & X-CUBE-AUDIO-KIT:
livetune Designer Source Code Compilation Error

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Could you tell me how to write this in C?
Would I need to use inline assembly?

It seems to be purely an issue for assembler?

I think you need to start a separate thread of your own (this one is already marked as solved), giving a full description of your particular situation.

You can always give a link back to this thread, for context.

 

How to write your question to maximize your chances to find a solution

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.