STM32CubeMX 6.10.0 doesn't copy all necessary I3C headers
Reproduction steps:
- Open STM32CubeIDE. “File” menu → “New” → “STM32 Project”.
- Switch to the “Board Selector”, and pick the NUCLEO-H503RB. Click “Next”.
- I've successfully reproduced this issue with the NUCLEO-H503RB and NUCLEO-H563ZI. I suspect it applies equally to every board or MCU part with I3C support.
- Give the project a unique name – I'm using “broken-mx”. Target the C language, an executable binary, and an STM32Cube project.
- Pick firmware package V1.1.1. Ensure the code generator is configured to “Copy only the necessary library files”. Click “Finish”.
- This issue can also be reproduced with firmware package V1.1.0. It's an STM32CubeMX problem, not a problem with the firmware package.
- When asked whether I wanted to “Initialize all peripherals with their default Mode ?”, I picked “Yes”.
- This issue can also be reproduced without default peripheral initialization. It just requires a couple more clicks as you'll have to acknowledge that the icache is disabled every time you generate code.
- The STM32CubeMX interface will load. In “Connectivity”, pick the “I3C1” peripheral, and change the mode to “Controller”.
- This is equally reproducable with the “Target” mode.
- Save changes to the IOC (Ctrl+S, “File” menu → “Save”, etc.). When prompted, generate code.
- Once code generation has completed, open `main.c`, then build the project (“Project” menu → “Build Project”).
Expected outcome: the project should build cleanly.
Actual outcome: compilation fails with an error:
arm-none-eabi-gcc "../Core/Src/system_stm32h5xx.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32H503xx -c -I../Core/Inc -I../Drivers/STM32H5xx_HAL_Driver/Inc -I../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/system_stm32h5xx.d" -MT"Core/Src/system_stm32h5xx.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/system_stm32h5xx.o"
../Drivers/STM32H5xx_HAL_Driver/Src/stm32h5xx_util_i3c.c:20:10: fatal error: stm32h5xx_util_i3c.h: No such file or directory
20 | #include "stm32h5xx_util_i3c.h"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
If I manually copy `stm32h5xx_util_i3c.h` from the HAL driver package into `Drivers/STM32H5xx_HAL_Driver/Inc/` in the project directory, the build does complete successfully. And regenerating code from STM32CubeMX removes the file from the source tree, requiring that it be manually copied in again.
This is a regression from STM32CubeMX 6.8.0.
I'm using STM32CubeIDE version 1.14.0, build “19471_20231121_1200 (UTC)”; and STM32CubeMX version 6.10.0-RC9, build “20231120-2037 (UTC)”.
