Skip to main content
Associate
February 26, 2026
Solved

system_stm32wb0x.c - dangerous relocation: unsupported relocation (CubeIDE, CubeMX)

  • February 26, 2026
  • 3 replies
  • 1306 views

Environment:

MCU: STM32WB09KE (Cortex-M0+)

Board: NUCLEO-WB09KE

STM32CubeIDE Version: 2.1.0

STM32CubeIDE Build: 27993_20260219_1630 (UTC)

STM32CubeMX Version: 6.17.0

Operating under Windows 11 Home.

The project previously built successfully before updating CubeIDE @ approx. 23 February 2026. The "Installation History" tab in CubeIDE poorly reflects this update action however.

Toolchain / IDE: STM32CubeIDE

Setup:

In this page, ST generously provides us a .zip folder containing existing application projects that STM32WB0-series users can import, edit, and build directly. Version: 1.4.0.

After extraction, the project "BLE_DirectionFinding_Central_Locator" (inside ..\<unzipped_folder>\STM32Cube_FW_WB0_V1.4.0\Projects\NUCLEO-WB09KE\Applications\BLE) is what I've been using.

Error

After updating CubeIDE, the following output appears on console:

13:43:14 **** Incremental Build of configuration Debug for project BLE_DirectionFinding_Central_Locator ****
make -j16 all 

arm-none-eabi-gcc -o "BLE_DirectionFinding_Central_Locator.elf" @"objects.list" -Wl,--start-group -l:libcrypto.a -l:stm32wb0x_ble_stack.a -Wl,--end-group -mcpu=cortex-m0plus -T"C:\Users\<censored>\STM32CubeIDE\<censored>\WB0_1.4.0_Unzipped_1\STM32Cube_FW_WB0_V1.4.0\Projects\NUCLEO-WB09KE\Applications\BLE\BLE_DirectionFinding_Central_Locator\STM32CubeIDE\STM32WB09KEVX_FLASH.ld" --specs=nosys.specs -Wl,-Map="BLE_DirectionFinding_Central_Locator.map" -Wl,--gc-sections -static -L../../../../../../../Middlewares/ST/STM32_BLE/cryptolib -L../../../../../../../Middlewares/ST/STM32_BLE/stack/lib -LC:/Users/<censored>/STM32Cube/Repository/STM32Cube_FW_WB0_V1.4.0/Middlewares/ST/STM32_BLE/cryptolib -LC:/Users/<censored>/STM32Cube/Repository/STM32Cube_FW_WB0_V1.4.0/Middlewares/ST/STM32_BLE/stack/lib -z noexecstack --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Common/BLE/Startup/cpu_context_switch.o(CPUcontextRestore): Unknown destination type (ARM/Thumb) in ./Drivers/CMSIS/system_stm32wb0x.o

./Drivers/CMSIS/system_stm32wb0x.o: in function `SystemInit':
C:/Users/<censored>/STM32CubeIDE/<censored>/WB0_1.4.0_Unzipped_1/STM32Cube_FW_WB0_V1.4.0/Projects/NUCLEO-WB09KE/Applications/BLE/BLE_DirectionFinding_Central_Locator/Core/Src/system_stm32wb0x.c:206:(.text.SystemInit+0x26): dangerous relocation: unsupported relocation

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:87: BLE_DirectionFinding_Central_Locator.elf] Error 1
"make -j16 all" terminated with exit code 2. Build might be incomplete.

13:43:16 Build Failed. 3 errors, 0 warnings. (took 1s.448ms)
 

Summarised:

Linker fails at ```Unknown destination type (ARM/Thumb) in ./Drivers/CMSIS/system_stm32wb0x.o
dangerous relocation: unsupported relocation```.

Cleaning the project and deleting the Debug folder does not resolve the issue.

Restarting the device and STM32CubeIDE does not resolve the issue.

The issue occurs on an untouched example project.

 

 

Is STM32Cube_FW_WB0_V1.4.0 validated against GNU tools for STM32 14.3.1?

 

Is there something I'm missing?

 

Do feel welcome to request files or more information.

Best answer by Mahmoud Ben Romdhane

Hello @MuradV 

 

Let me thank you for bringing this issue to our attention.

The issue has been submitted to the dedicated team under this internal ticket (Ticket Number: 228023).

As WA I recommend that you install GNU Tools for STM32 (13.3.rel1) in STM32CubeIDE 2.1.0, then build the example: BLE_DirectionFinding_Peripheral_Tag.

 

Thanks.

Mahmoud

 

 

3 replies

Technical Moderator
February 26, 2026

Hello @@MuradV 

Let me thank you for posting and welcome to the ST Community.

I am currently checking this behavior, and I will get back to you ASAP.

Thanks.

Mahmoud

 

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.
MuradVAuthor
Associate
February 27, 2026

To fellow readers and helpers,

 

It was observed that this problem could not be replicated on another device (oop, nevermind, read the Edit below), as the user managed to import the example and build the project successfully.

So it appears, this problem occurs only on my end, how demotivating!

I tried it again.

  • I've downloaded the zip from ST, extracted.
  • Created a new workspace in STM32CubeIDE
  • Imported the desired project.
  • Compile... then the same error appears.

I then accessed the .ioc file of the project, and pressed on "generate code", for the sake of debugging and to refresh.

And now, when I try to build the project, the console silently and quickly prints: 

**** Build of configuration Debug for project BLE_DirectionFinding_Central_Locator ****

Nothing to build for project BLE_DirectionFinding_Central_Locator

 I don't understand.

Edit: It appears as though the issue is confirmed to exist by another user. I'll attempt a workaround Mahmoud suggested, to install gcc 13 on CubeIDE 2.1.0 manually and rebuild the project.

Edit: Late edit, apologies, but installing gcc 13 did help. Projects that failed to compile correctly, I accessed their properties, C/C++ Build, Settings, MCU/MPU Toolchain under Tool Settings tab, thereafter changed the GNU tools used. That helped. 

MuradVAuthor
Associate
February 27, 2026

I'll attach a few files from the project. Let me know if you'd like me to attach more files or info. 

 

Technical Moderator
February 27, 2026

Hello @MuradV 

 

Let me thank you for bringing this issue to our attention.

The issue has been submitted to the dedicated team under this internal ticket (Ticket Number: 228023).

As WA I recommend that you install GNU Tools for STM32 (13.3.rel1) in STM32CubeIDE 2.1.0, then build the example: BLE_DirectionFinding_Peripheral_Tag.

 

Thanks.

Mahmoud

 

 

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.
Andrew Neil
Super User
March 3, 2026

@Mahmoud Ben Romdhane It seems this is due to a change in the GCC assembler?

Solution is to fix the system_stm32wb0x (and system_stm32wl3x ?) sources:

https://community.st.com/t5/stm32cubeide-mcus/cubeide-2-1-0-system-stm32wl3x-o-dangerous-relocation/m-p/883259/highlight/true#M41183

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.