Skip to main content
Associate
July 22, 2025
Solved

STM32CubeIDE: main.h includes "stm32h5xx_hal.h" which doesn't exist

  • July 22, 2025
  • 3 replies
  • 603 views

Hello,


I am currently trying to develop for the STM32H573RIT6 microcontroller, however after generating a new project I run into an issue where I am unable to compile any code due to main.h attempting to include "stm32h5xx_hal.h", but it fails to compile as it fails to locate that file. The only file that I was able to locate was "stm32h5xx_hal_conf.h", but replacing that in the "main.h" file still fails to compile as it cannot find "stm32h5xx_hal_spi.h" and "stm32h5xx_hal_gpio.h". system_stm32h5xx.c also attempts to include the "stm325xx_hal.h" file as well and as a result errors.

Spectre_0-1753144248504.png

 

Best answer by Mahmoud Ben Romdhane

Hello @Spectre ,

 

I tried to reproduce your behavior, and I was not able to generate the code. Knowing that I am using STM32CubeMX 6.14.1.

MahmoudBenRomdhane_0-1753178114206.png

After investigation, I found a mismatch and contradiction between the MCU reference (Mcu.Name=STM32H573RITx) and the Firmware Package (STM32Cube FW_H7 V1.12.1) by opening the Ioc.File with Note Pad.

I imported the same configurations through a new Ioc and the project build was finished with 0 errors.

I will be waiting for your feedback.

 

Thanks.

Mahmoud

 

 

3 replies

TDK
Super User
July 22, 2025

Works fine here. Include the IOC file that generates the faulty code.

TDK_0-1753155379187.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
SpectreAuthor
Associate
July 22, 2025

@TDK Attached should be the .ioc file that generated this code. Thanks for your help so far.

Technical Moderator
July 22, 2025

Hello @Spectre ,

 

First let me thank you for posting and welcome to the ST Community.

For more investigation, I suggest that you provide your Ioc.File.

 

Thanks.

Mahmoud

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.
SpectreAuthor
Associate
July 22, 2025

In my reply to @TDK, I provided my .ioc file. If you cannot access it please let me know and I will upload it again.

Technical Moderator
July 22, 2025

Hello @Spectre ,

 

I tried to reproduce your behavior, and I was not able to generate the code. Knowing that I am using STM32CubeMX 6.14.1.

MahmoudBenRomdhane_0-1753178114206.png

After investigation, I found a mismatch and contradiction between the MCU reference (Mcu.Name=STM32H573RITx) and the Firmware Package (STM32Cube FW_H7 V1.12.1) by opening the Ioc.File with Note Pad.

I imported the same configurations through a new Ioc and the project build was finished with 0 errors.

I will be waiting for your feedback.

 

Thanks.

Mahmoud

 

 

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.