STM32H745I-DISCO STM32CubeIDE doesn't create middlewares for TouchGFX project.
I just created STM32H745I-DISCO TouchGFX project with TouchGFX.
That passed, I was able to import the project to the STM32CubeIDE.
Then I just added USB_OTG_FS peripheral configured with host class (HOST_ONLY for USB disk).
Saving changes in CubeIDE caused several errors about missing files. I recently worked on the same thing on STM32H747I-DISCO board and it worked. So I compared those 2 projects. The STM32H745I-DISCO project just misses Middlewares directory in STM32CubeIDE dicrectory. The directory in project root exists, however it misses most of the necessary files. Also, the necessary include directories are not present in the 745 project.
So - to make it clear: The code generator for STM32H745I doesn't create any configuration for middleware files. It should do it, because this is how it works for STM32H747I project.
To reproduce the issue:
- Create new TouchGFX project for STM32H745I-DISCO.
- Import the project to a new STM32CubeIDE workspace.
- Build and run the project. (That should work.)
- Add USB_OTG_FS peripheral for CM7 core.
- Configure the peripheral as HOST_ONLY, Mass Storage Class
- Save the changes and try to build the project.
The steps performed for 745 fail. There are missing files.
The same steps performed for 747 pass.
UPDATE:
The problem seems to be specific to TouchGFX. When I generated new STM32CubeIDE project from STM32CubeIDE, not TouchGFX Designer, the middleware files are generated correctly. However, now I have completely no idea how to add TouchGFX support to it.
UPDATE:
A workaround. First, create an empty project for the board with STM32CubeIDE. Add required middlewares. At least the correct directory structure will be created, main application files to be used as templates also will be created. That's all about that project. Start a new project with TouchGFX Designer. Copy the application directories somewhere aside TouchGFX application directory. If the directories aren't already added to include paths, add them.
Then the most important part: clone the https://github.com/STMicroelectronics/STM32CubeH7 repository. Or other relevant one from STMicroelectronics. Copy some, or even all middlewares to the CubeIDE project. Add include directories if needed. Then try to build the project to see hundreds of errors. The important information is the files that cause errors. Exclude them from compilation (they probably require additional configuration in the project). Rinse and repeat until no more compile errors occur.
It works, however, it takes some time to apply. For STM32H747I-DISCO I didn't have to apply those workarounds, the code generator for the TouchGFX project just worked as intended. It both copied the necessary files, added include paths and created virtual links to the required c files.
Anyway - this allows using all STM32H745I-DISCO features with TouchGFX projects and STM32CubeIDE.
The problem is not solved - it's just a workaround. Is there a way to peek how TouchGFX configures the supported boards by ST? Is there a publicly accessible repo with boards configurations? How should I report possible bugs with those things/