Why do I see missing header files when I try to build my model for STM32 Boards using Embedded Coder?
Show older comments
I am trying to generate code for a very simple model with using Embedded Coder R2023a with the Embedded Coder Support Package for STMicroelectronics STM32 Processors package. I made sure all the blocks I am using are from this support package, so there should be no compatibility issues. However, I keep seeing the following error when building:
C:/Users/MyUser/Documents/My Documents/STM32Project/Core/Inc/stm32f7xx_hal_def.h:29:10: fatal error: stm32f7xx.h: No such file or directory
29 | #include "stm32f7xx.h"
What I have checked and tried so far:
- I am using compatible versions of STM32CubeMX 6.4.0 and v1.16.2 for the STM32F7 Firmware package downloaded through the hardware support package setup popup in MATLAB.
- In model settings I set “F7xx Based” in “Configuration Parameters -> Hardware Implementation”
- I cleared all my cache, "slprj", and other build artifacts before building
- I created a new .ioc file from the Model Settings
- After successfully creating this .ioc file, I checked the firmware path in STM32CubeMX under "Project Manager -> MCU and Firmware Package" is set to "STM32Cube FW_F7_V1.16.2"
- I ran the following command and manually checked that the firmware is installed correctly:
setpref('MW_STM32','STM32CubeFW','C:/Users/MyUser/STM32Cube/Repository/')
Then when I generate code, I am able to see the missing header file in a Drivers folder in the same directory as the model. However, I still get the error when building.
Accepted Answer
More Answers (0)
Categories
Find more on STMicroelectronics Discovery Boards in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!