cancel
Showing results for 
Search instead for 
Did you mean: 

fatal error: stm32h7xx_hal_ltdc.h: No such file or directory

VH-tech
Associate II

Hi, 

I am trying to run a touchgfx designer generated project in cubeIDE but when I go to the IDE and enable I2C1 in the .ioc file... I get the following error while building:

 

C:/TouchGFXProjects/blabla/TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp:57:10: fatal error: stm32h7xx_hal_ltdc.h: No such file or directory

57 | #include "stm32h7xx_hal_ltdc.h"

compilation terminated.

 

I am using stm32h735G-DK and touchGFX 4.24.0.

I am a complete newbie here and any help would be greatly appreciated!

Thanks,

Vatsal

4 REPLIES 4

Make sure the project's Include Path points to the HAL include directory. 

If auto-generated and not copied over at that time, use your file manager to copy over from the Cube directory to the project's. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes, my projects include path points to the STM32H7xx_HAL_Driver/Inc... Is there any other file that I might be missing ?

VHtech_0-1720708914935.png

 

If that is a localized copy of STM32H7xx_HAL_Driver/Inc then you'll want to copy the file it's complaining is missing from the primary repository, wherever you have that situated.

\STM32Cube\Repository\STM32Cube_FW_F7_V1.17.1\Drivers\STM32F7xx_HAL_Driver\Inc\stm32f7xx_hal_ltdc.h

It's complaining about this one file, is it present, or not? If not copy it over, and check if it complains about any others.

I'd half expect stm32f7xx_hal_ltdc_ex.h to be missing too

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hello @VH-tech,

I suggest using STM32CubeMX to open the .ioc file, and then you can enable I2C from there and generate code. Then, add your code through STM32CubeIDE.

So, you select the STM32H735G-DK from the TouchGFX designer and create a project:

STM32H735G-DK TouchGFX Board SetupSTM32H735G-DK TouchGFX Board Setup

You navigate to one previous level of your TouchGFX project directory, and open the .ioc file using STM32CubeMX:

.ioc file.ioc file

Then, you enable I2C1 and press Generate Code:

Enabling I2C and generating codeEnabling I2C and generating code

After that, you need to regenerate code from TouchGFX as well, and then you should be able to compile the project from STM32CubeIDE without any errors.

I hope this helps you. Don't hesitate to ask more questions!

 

Mohammad MORADI
ST Software Developer | TouchGFX