cancel
Showing results for 
Search instead for 
Did you mean: 

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

kclauah
Associate

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 2
Andrew Neil
Super User

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.

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.