cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect static library link order in CubeMX generated BLE CMake project for STM32WBA

jmk
Associate II

Hello,

When generating a basic Bluetooth project for NUCLEO‑WBA55CG using STM32CubeMx 6.17 (and 6.16) with Cmake as the toolchain, the project compilation fails to a missing symbol during the link stage.

Here is the error message:

le_ctrl.c:(.text.HCI_READ_LOCAL_VERSION_INFORMATION+0x20): undefined reference to `ll_sys_get_brief_fw_version'


After investigation, it turns out the issue is caused by the incorrect order of linked static BLE libraries in the generated CMake file "cmake/stm32cubemx/CMakeLists.txt". CubeMX places the Link Layer and BLE Stack libraries in an order that prevents the linker from resolving symbols correctly. Reordering the libraries fixes the issue.


Here is the corrected order that resolves the error:

# Project static libraries
set(MX_LINK_LIBS  
    :stm32wba_ble_stack_basic.a
    :WBA5_LinkLayer_BLE_Basic_lib.a 
    STM32_Drivers
    ${TOOLCHAIN_LINK_LIBRARIES}
    Utilities
	STM32_WPAN
	Common
	
)

 
Best regards

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @jmk 

Your contribution is much appreciated.

Two tickets  227523 and 226286 have been escalated to dev team to correct this issue.

I will keep you posted with updates.

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.

View solution in original post

3 REPLIES 3
Ghofrane GSOURI
ST Employee

Hello @jmk 

I'm currently checking this behavior. I will get back to you ASAP.

It would be useful if you could provide your IOC to reproduce the issue.

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.

@Ghofrane GSOURI, Here is my IOC file.

I'm using cmake version 4.0.2.

Hello @jmk 

Your contribution is much appreciated.

Two tickets  227523 and 226286 have been escalated to dev team to correct this issue.

I will keep you posted with updates.

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.