2025-01-16 12:04 PM
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.
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.
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
Thank you in advance!
Afshin
Solved! Go to Solution.
2025-02-12 07:34 AM
I did install STM32CubeMX-Win version 6.13.0, and generated code exactly as mentioned above, and then imported the project to STM32CUBe ide from File > import > general > CubeMX .ico file
then navigated to main.c and pressed compile, I got the error below. I am not sure why BLE on this specific microcontroller is problematic.
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:/Users/Afshin/Desktop/anyfolder/TestBLEMX/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:/Users/Afshin/Desktop/anyfolder/TestBLEMX/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:/Users/Afshin/Desktop/anyfolder/TestBLEMX/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/Src/stm32wb0x_hal_radio_timer.o: in function `HAL_RADIO_TIMER_Init':
C:/Users/Afshin/Desktop/anyfolder/TestBLEMX/Debug/../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':
C:/Users/Afshin/Desktop/anyfolder/TestBLEMX/Debug/../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':
C:/Users/Afshin/Desktop/anyfolder/TestBLEMX/Debug/../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':
C:/Users/Afshin/Desktop/anyfolder/TestBLEMX/Debug/../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':
C:/Users/Afshin/Desktop/anyfolder/TestBLEMX/Debug/../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:/Users/Afshin/Desktop/anyfolder/TestBLEMX/Debug/../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:76: TestBLEMX.elf] Error 1
"make -j24 all" terminated with exit code 2. Build might be incomplete.
08:28:39 Build Failed. 11 errors, 1 warnings. (took 1s.392ms)
2025-02-12 07:54 AM
Generate the code to CubeIDE from CubeMX and don’t import it. On CubeMX, Go to project Manager > Project > select CubeIDE as your IDE and give the project a name. Then, click on generate code.
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.
2025-02-12 10:06 AM
I did, and still same issue. Attached is the zipped folder of the project created with CubeMX. I would appreciate if you could try compiling on your end, or making a project from scratch for STM32WB05KZV6TR. To me I think its the project settings where assembly files are not complied in order, maybe a bug, but only this specific chip gives me hard time, but we can't change it since we have our hardware manufactured, and we followed datasheet for the design, to exact specs.
2025-02-13 05:55 AM
Hello @drafshin
I've added a project that does compile on the STM32CubeIDE V1.17.0. Please open it as it is or generate your own based on the .ioc file of this project (don't change parameters). After that create another project (any project on any MCU not the STM32WB0) I've got already other projects on my side too:
After that compile the project based on the STME32WB0. You may receive another message. After that compile the other project and recompile your STM32WB0 project. This time it should be working fine with this workaround:
PS: this behavior will be solved on the coming release (coming in a few days) of the STM32CubeMX.
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.
2025-02-15 04:21 PM - edited 2025-02-15 04:22 PM
Sorry for late reply, I got another project and couldn't try your code erlier.
I followed your suggestions and did the followings
1. Downloaded the project you attached and opened it in CubeIDE
2. create a project for a STM32F07 and copied. a simple serial, and built it
3. I built the project you provided. (I had to clean to remove a cash error, for future people want to try this)
and I think it worked! I got only the following error but hex generated.
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
Thank you for the help
2025-02-15 05:37 PM - edited 2025-02-15 08:18 PM
I got some treble with RTC, but overall looks working.