cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745I-DISCO STM32CubeIDE doesn't create middlewares for TouchGFX project.

HTD
Senior III

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:

  1. Create new TouchGFX project for STM32H745I-DISCO.
  2. Import the project to a new STM32CubeIDE workspace.
  3. Build and run the project. (That should work.)
  4. Add USB_OTG_FS peripheral for CM7 core.
  5. Configure the peripheral as HOST_ONLY, Mass Storage Class
  6. 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/

23 REPLIES 23

Since I played with the 745I-DISCO board more, I think I've found a good workaround for most issues, especially the broken links causing compile errors. Not all of mentioned bugs can be fixed with this, but adding and removing components to the projects (as drivers and middlewares) is day to night now. I'm very busy at the moment, but I'll create a new project on GitHub with some internal hardware preconfigured and a debugging console for LCD screen to perform some tests like GPIO, PWM, mass storage and such. I can also add my eMMC FATFS diskio driver, since it's probably the easiest way to make use of the built-in eMMC. It also illustrates how to convert BSP API from the STM H745 repo templates to HAL compatible drivers. Expect the project on Monday.

HTD
Senior III

I think it's just new release policy everywhere... Microsoft Windows included ;) We get the fresh stuff, hot, just baked, but it's not even beta quality. It's like early alpha, a lot of bugs, it barely works, some features are broken.

But look at the bright side - it will take some time before it goes mainstream. If you're able to work around the rough edges - you've got the latest cutting edge tech before anyone else. The harder it's for us, the harder it is for everyone else.

Looking back at my latest adventure with STM32H7 disco boards - having to tweak it a lot to make it just work at all has taught me a lot. Having to fix broken project structure has taught me how the project is built, where sits what and why it's there. Also - how to add my own components, like the eMMC driver. All the code is already released by STM application team on GitHub, it doesn't just work out of the box, it needs to be configured and tweaked first. At least when using STM32CubeIDE, some other IDEs have better support. I use STM32CubeIDE because of its Hardware Configuration Tool (it's better, more modern than CubeMX), it saves a lot of time to make a proper hardware initialization. Then it's free. And even that Eclipse based editor is not that bad. Sure, it's slow, some features are broken, but after using Visual Studio / Visual Studio Code for C++ for a while - they are not perfect too and have their own quirks. So I stick to STM32CubeIDE because it just does the job most of the time, if it only was a little faster...

NSeba
Associate III

Me too was able to compile my TouchGFX application with the help of gentleman @MM..1​ 

I like glass half-full people :grinning_face:​