Skip to main content
Associate II
November 18, 2025
Question

Build fails on NUCLEO-WBA55CG after enabling X-CUBE-MEMS

  • November 18, 2025
  • 2 replies
  • 302 views

Hello,

I have been working with a NUCLEO-WBA55CG board and the X-NUCLEO-IKS02A1 expansion board. I am running into an issue where the project fails to build after I enable the X-CUBE-MEMS software pack.

Here are the steps to reproduce the problem:

  1. In STM32CubeIDE, create a new STM32 project using the "Board Selector" for the NUCLEO-WBA55CG.
  2. In the Pinout & Configuration view, enable the I2C1 peripheral and assign it to pins PB1 and PB2.
  3. Under "Software Packs," enable X-CUBE-MEMS1 for the IKS02A1 and select I2C1 as the communication interface.
  4. Generate the code and build the project.

After building, I receive the following error messages in the console.

../Drivers/BSP/STM32WBAxx_Nucleo/stm32wbaxx_nucleo.c: In function 'BSP_PB_Init':
../Drivers/BSP/STM32WBAxx_Nucleo/stm32wbaxx_nucleo.c:316:56: error: 'BSP_B1_IT_PRIORITY' undeclared (first use in this function)
 316 | uint32_t BSP_BUTTON_IT_PRIO[BUTTONn] = {BSP_B1_IT_PRIORITY,
 | ^~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32WBAxx_Nucleo/stm32wbaxx_nucleo.c:316:56: note: each undeclared identifier is reported only once for each function it appears in
arm-none-eabi-gcc "../Core/Src/stm32wbaxx_hal_msp.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DUSE_NUCLEO_64 -DUSE_HAL_DRIVER -DSTM32WBA55xx -c -I../Core/Inc -I../Drivers/STM32WBAxx_HAL_Driver/Inc -I../Drivers/STM32WBAxx_HAL_Driver/Inc/Legacy -I../Drivers/BSP/STM32WBAxx_Nucleo -I../Drivers/CMSIS/Device/ST/STM32WBAxx/Include -I../Drivers/CMSIS/Include -I../X-CUBE-MEMS1/Target -I../Drivers/BSP/Components/ism330dhcx -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32wbaxx_hal_msp.d" -MT"Core/Src/stm32wbaxx_hal_msp.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/stm32wbaxx_hal_msp.o"
../Drivers/BSP/STM32WBAxx_Nucleo/stm32wbaxx_nucleo.c:317:56: error: 'BSP_B2_IT_PRIORITY' undeclared (first use in this function)
 317 | BSP_B2_IT_PRIORITY,
 | ^~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32WBAxx_Nucleo/stm32wbaxx_nucleo.c:318:56: error: 'BSP_B3_IT_PRIORITY' undeclared (first use in this function)
 318 | BSP_B3_IT_PRIORITY};
 | ^~~~~~~~~~~~~~~~~~
arm-none-eabi-gcc "../Core/Src/stm32wbaxx_it.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DUSE_NUCLEO_64 -DUSE_HAL_DRIVER -DSTM32WBA55xx -c -I../Core/Inc -I../Drivers/STM32WBAxx_HAL_Driver/Inc -I../Drivers/STM32WBAxx_HAL_Driver/Inc/Legacy -I../Drivers/BSP/STM32WBAxx_Nucleo -I../Drivers/CMSIS/Device/ST/STM32WBAxx/Include -I../Drivers/CMSIS/Include -I../X-CUBE-MEMS1/Target -I../Drivers/BSP/Components/ism330dhcx -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32wbaxx_it.d" -MT"Core/Src/stm32wbaxx_it.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/stm32wbaxx_it.o"
make: *** [Drivers/BSP/STM32WBAxx_Nucleo/subdir.mk:19: Drivers/BSP/STM32WBAxx_Nucleo/stm32wbaxx_nucleo.o] Error 1
make: *** Waiting for unfinished jobs....
../Core/Src/main.c:44:1: error: unknown type name 'COM_InitTypeDef'; did you mean 'I2C_InitTypeDef'?
 44 | COM_InitTypeDef BspCOMInit;
 | ^~~~~~~~~~~~~~~
 | I2C_InitTypeDef
../Core/Src/main.c: In function 'main':
../Core/Src/main.c:108:13: error: request for member 'BaudRate' in something not a structure or union
 108 | BspCOMInit.BaudRate = 115200;
 | ^
../Core/Src/main.c:109:13: error: request for member 'WordLength' in something not a structure or union
 109 | BspCOMInit.WordLength = COM_WORDLENGTH_8B;
 | ^
../Core/Src/main.c:109:27: error: 'COM_WORDLENGTH_8B' undeclared (first use in this function); did you mean 'UART_WORDLENGTH_8B'?
 109 | BspCOMInit.WordLength = COM_WORDLENGTH_8B;
 | ^~~~~~~~~~~~~~~~~
 | UART_WORDLENGTH_8B
../Core/Src/main.c:109:27: note: each undeclared identifier is reported only once for each function it appears in
../Core/Src/main.c:110:13: error: request for member 'StopBits' in something not a structure or union
 110 | BspCOMInit.StopBits = COM_STOPBITS_1;
 | ^
../Core/Src/main.c:110:27: error: 'COM_STOPBITS_1' undeclared (first use in this function); did you mean 'UART_STOPBITS_1'?
 110 | BspCOMInit.StopBits = COM_STOPBITS_1;
 | ^~~~~~~~~~~~~~
 | UART_STOPBITS_1
../Core/Src/main.c:111:13: error: request for member 'Parity' in something not a structure or union
 111 | BspCOMInit.Parity = COM_PARITY_NONE;
 | ^
../Core/Src/main.c:111:27: error: 'COM_PARITY_NONE' undeclared (first use in this function); did you mean 'UART_PARITY_NONE'?
 111 | BspCOMInit.Parity = COM_PARITY_NONE;
 | ^~~~~~~~~~~~~~~
 | UART_PARITY_NONE
../Core/Src/main.c:112:13: error: request for member 'HwFlowCtl' in something not a structure or union
 112 | BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;
 | ^
../Core/Src/main.c:112:27: error: 'COM_HWCONTROL_NONE' undeclared (first use in this function); did you mean 'UART_HWCONTROL_NONE'?
 112 | BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;
 | ^~~~~~~~~~~~~~~~~~
 | UART_HWCONTROL_NONE
../Core/Src/main.c:113:7: warning: implicit declaration of function 'BSP_COM_Init'; did you mean 'BSP_PB_Init'? [-Wimplicit-function-declaration]
 113 | if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE)
 | ^~~~~~~~~~~~
 | BSP_PB_Init
../Core/Src/main.c:113:20: error: 'COM1' undeclared (first use in this function); did you mean 'COMP1'?
 113 | if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE)
 | ^~~~
 | COMP1
make: *** [Core/Src/subdir.mk:37: Core/Src/main.o] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.

 

Any ideas on what could be causing this build failure?

Thank you for your help.

 

STM32CubeIDE: 1.19.0

STM32Cube MCU Pack for STM32WBA series: 1.7.0

X-CUBE-MEMS1: 11.3.0

Windows 10

2 replies

Andrew Neil
Super User
November 18, 2025

All of those errors are referring to missing BSP (Board Support Package) things - so did you enable the BSP ?

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.
kclauahAuthor
Associate II
November 18, 2025

Thank you for the suggestion!

Yes, I can confirm that all the necessary BSP components were enabled for the expansion board.

stm32 build.PNG

I also ran another test: I kept I2C1 enabled but disabled the X-CUBE-MEMS1 pack. With that change, all the build errors disappeared. This seems to confirm the issue is specifically with the MEMS software pack. 

kclauahAuthor
Associate II
November 19, 2025

I have an update and a temporary workaround.

By comparing the generated code from a project with X-CUBE-MEMS1 enabled against one without, I found that the build errors are resolved by making two manual changes:

 

  • Setting USE_BSP_COM_FEATURE to 1U.
  • Adding the following missing definitions
#define BSP_B1_IT_PRIORITY 15U
#define BSP_B2_IT_PRIORITY 15U
#define BSP_B3_IT_PRIORITY 15U

 

The project now compiles successfully.

However, the main issue now is that these manual changes are overwritten and lost every time I modify the .ioc file and regenerate the code. Is there a way within CubeMX to make these settings permanent, or does this seem like a bug in the code generator for this software pack?

Andrew Neil
Super User
November 19, 2025

@kclauah wrote:
  • Setting USE_BSP_COM_FEATURE to 1U.

You'd have thought that should be covered by this setting:

AndrewNeil_0-1763546815579.png

@STOne-32 

 


@kclauah wrote:

these manual changes are overwritten and lost every time I modify the .ioc file and regenerate the code. 


You should be able to find a place within a USER CODE section to prevent that ?

(Of course, this doesn't alter the fact that you shouldn't need to do it at all)

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.
kclauahAuthor
Associate II
November 20, 2025

You'd have thought that should be covered by this setting:


Thank you for your response. And I also had the same expectation that the code generator would define everything automatically.

As my screenshot shows in above reply, the problem starts the moment I enable the X-CUBE-MEMS1 pack. The BSP IT priority definitions are removed and USE_BSP_COM_FEATURE changed to 0U

 

You should be able to find a place within a USER CODE section to prevent that ?

(Of course, this doesn't alter the fact that you shouldn't need to do it at all)


I have tried placed those definition code in USER CODE Header block in stm32wbaxx_nucleo_conf.h. The code disappeared once I run "Device Configuration Tool Code Generation".