cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB05KZV6TR BLE compile issue

drafshin
Associate

 

Hello STM32 Community,

I’m currently working with an STM32WB05KZV6TR microcontroller and am facing issues after adding the STM32_BLE to my project. I initially configured a BLE peripheral using STM32CubeMX and STM32CubeIDE, and after code is generated, it does not compile. it looks like it can't find the .s file

here are some of the errors:

 

 

C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp/crtn.o: missing .note.GNU-stack section implies executable stack
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/app_entry.o: in function `MX_APPE_Init':
./Core/Src/app_entry.c:102: undefined reference to `HW_RNG_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/app_entry.c:108: undefined reference to `HW_AES_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/app_entry.c:109: undefined reference to `HW_PKA_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.o: in function `HAL_RADIO_TIMER_Init':
./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:355: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.o: in function `HAL_RADIO_TIMER_MachineTimeToSysTime':
./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:860: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.o: in function `_configureTxRxDelay':
./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1153: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.o: in function `_update_xtal_startup_time':
./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1187: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.o: in function `_get_system_time_and_machine':
./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1241: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.o:C:/AfshinFiles/Projects/Nultra/Firmware/Nultra/Debug/../Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1244: more undefined references to `blue_unit_conversion' follow
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/App/app_ble.o: in function `ModulesInit':
./STM32_BLE/App/app_ble.c:198: undefined reference to `PKAMGR_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/App/app_ble.o: in function `BLE_Init':
./STM32_BLE/App/app_ble.c:293: undefined reference to `aci_gatt_srv_profile_init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/App/app_ble.c:327: undefined reference to `aci_gap_profile_init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/App/app_ble.c:342: undefined reference to `Gap_profile_set_dev_name'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/App/app_ble.c:353: undefined reference to `Gap_profile_set_appearance'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/App/app_ble.o: in function `NVM_Process':
./STM32_BLE/App/app_ble.c:462: undefined reference to `NVMDB_Tick'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/Target/blenvm.o: in function `BLENVM_Init':
./STM32_BLE/Target/blenvm.c:129: undefined reference to `NVMDB_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/Target/blenvm.c:131: undefined reference to `NVMDB_HandleInit'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/Target/blenvm.c:132: undefined reference to `NVMDB_HandleInit'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/Target/blenvm.o: in function `BLEPLAT_NvmAdd':
./STM32_BLE/Target/blenvm.c:155: undefined reference to `NVMDB_AppendRecord'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/Target/blenvm.o: in function `BLEPLAT_NvmGet':
./STM32_BLE/Target/blenvm.c:195: undefined reference to `NVMDB_ReadCurrentRecord'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./STM32_BLE/Target/blenvm.c:201: undefined reference to `NVMDB_HandleInit'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-ea

 

 

 

The errors highlight multiple undefined references, particularly to blue_unit_conversion and functions like HW_RNG_Init, HW_AES_Init, and PKAMGR_Init, as well as references to several other functions related to BLE and cryptography.

Steps I Took to Resolve:

  1. Tried Adding blue_unit_conversion.s to Assembler: To fix the undefined reference to 'blue_unit_conversion' error, I added the blue_unit_conversion.s file in the assembler section of the project settings.

  2. Encountered New Issue with Reset_Handler: After adding blue_unit_conversion.s, I encountered the following error:

     
    `

 

 

warning: cannot find entry symbol Reset_Handler; defaulting to 10040000​

 

 

  • Can someone provide guidance on resolving the undefined reference errors?
  • Any advice or solutions would be greatly appreciated!

Thank you in advance!

Afshin

3 REPLIES 3
STTwo-32
ST Employee

Hello @drafshin 

I suggest you follow those steps:

  1. Enable the RNG.
  2. Disable the generate under root.
  3. Select the "Add necessary library files as reference in the toolchain project configuration file": STTwo32_0-1738595535120.png
  4. On the Generate function call, follow this screenshot:

     

    STTwo32_2-1738595633492.png

     

  5. If you compile and still have an error like this:
    C:/ST/STM32CubeIDE_1.17.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    has context menu​
    Create any other project, compile it and after that recompile your own project without cleaning it. (This behavior will be solved on the future. I've reported under internal ticket number 202117.

Best Regards.

STTwo-32

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.

Hello STTwo-32,

 

Thank you for the reply. I followed your suggestions and I still get error, here screenshots of my settings. 

drafshin_0-1739157447586.png

 

drafshin_2-1739157477175.png

 

C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp/crtn.o: missing .note.GNU-stack section implies executable stack
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/app_entry.o: in function `MX_APPE_Init':
C:/AfshinFiles/Projects/Nultra/Firmware/Nultra/Debug/../Core/Src/app_entry.c:100: undefined reference to `HW_RNG_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/AfshinFiles/Projects/Nultra/Firmware/Nultra/Debug/../Core/Src/app_entry.c:106: undefined reference to `HW_AES_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/AfshinFiles/Projects/Nultra/Firmware/Nultra/Debug/../Core/Src/app_entry.c:107: undefined reference to `HW_PKA_Init'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/stm32wb0x_hal_radio_timer.o: in function `HAL_RADIO_TIMER_Init':
C:/Users/Afshin/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:355: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/stm32wb0x_hal_radio_timer.o: in function `HAL_RADIO_TIMER_MachineTimeToSysTime':
C:/Users/Afshin/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:860: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/stm32wb0x_hal_radio_timer.o: in function `_configureTxRxDelay':
C:/Users/Afshin/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1153: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/stm32wb0x_hal_radio_timer.o: in function `_update_xtal_startup_time':
C:/Users/Afshin/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1187: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/stm32wb0x_hal_radio_timer.o: in function `_get_system_time_and_machine':
C:/Users/Afshin/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1241: undefined reference to `blue_unit_conversion'
C:/ST/STM32CubeIDE_1.16.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WB0x_HAL_Driver/stm32wb0x_hal_radio_timer.o:C:/Users/Afshin/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Drivers/STM32WB0x_HAL_Driver/Src/stm32wb0x_hal_radio_timer.c:1244: more undefined references to `blue_unit_conversion' follow
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:72: Nultra.elf] Error 1
"make -j24 all" terminated with exit code 2. Build might be incomplete.

20:13:21 Build Failed. 11 errors, 5 warnings. (took 542ms)

 

I am new to STM32 family and this is my first project with STM32Cube so I am not sure what do you mean create a new project? should I create an empty project then add my files to it? would you clarify the steps please.

 

Thank you,

Afshin

First, try using the STM32XCubeIDE V1.17.0.

Best Regards.

STTwo-32

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.