Skip to main content
Martin KJELDSEN
Principal III
May 21, 2019
Question

STM32CubeIDE and TouchGFX 4.10.0: Resolving compilation issues

  • May 21, 2019
  • 95 replies
  • 18168 views

Hi everyone,

I've removed the previous, textual guide. Instead, here's a video guide on how to get CubeIDE and TouchGFX working on an STM32F746G-DISCO board. I accidentally exported the video in 720p but have created a 1080p version. Leaving both links here because the 720p version may have useful comments and resolutions:

1080p: https://youtu.be/VOs2LYO7wSA

720p: https://youtu.be/xZ0pPhQCQUY

And here's the project i created and modified:

https://community.st.com/s/question/0D50X0000At0N95SQE/cubeide-100-touchgfx-4100-working-project-inside-stm32f746gdisco

 (NOTE: This project does not have the modifications from our STM32F746G-DISCO/CubeMX article).

Best regards,

Martin

This topic has been closed for replies.

95 replies

Valentin Gros
Associate II
June 3, 2019

Thanks for the video, but unfortunately, I can't read any text on the video (screen resolution 1680x1050). I'll try to watch it at home.

Martin KJELDSEN
Principal III
June 4, 2019

I've updated the main post with a 1080p version of the video, which was the intended quality all a long. Sorry for the glitch!

/Martin

scottSD
Senior III
June 4, 2019

Thanks Martin! I will check out the new version of the video. I really appreciate it.

Valentin Gros
Associate II
June 5, 2019

Hello,

Thank you Martin for your 1080p video. I tried to follow it but I have the same problem as last time. When I try to build the project many paths of .hpp files are wrong. The .hpp files exist but the paths are wrong. For example, I get the following error : C:/STM32CubeProject/GenerateurPulse/TouchGFX/gui/include/gui/common/FrontendHeap.hpp:4:10: fatal error: gui_generated/common/FrontendHeapBase.hpp: No such file or directory

So I started add all the paths of the .hpp in "Includes " (Path and symbol window). However it take too much time. Do you think I have a problem with the general properties of CubeIDE ?

Valentin

eng23
Senior
June 5, 2019

Hi @Valentin Gros​ ,

I have a problem every time when I generate code in CubeMX, it erases the path configurations and I need to add manually.

Please check your path and symbol window, it needs to be like this (pay attention in excluded paths too):

0690X000008iHEzQAM.png

Regards,

Anderson

Valentin Gros
Associate II
June 7, 2019

Hello eng23,

Thank you for your answer, I will try.

Thomas Laurenson
Associate II
June 12, 2019

Hi @Martin KJELDSEN​ 

Firstly, thanks a lot for this guide, very helpful.

However I have an issue when I want to integrate somes images.

I started from your working project and then added somes images, but then I get this error:

'ExtFlashSection will not fit in region 'FLASH'

0690X000008iYtTQAU.png

I guess it's because the linker needs to be updated to support the QSPI Flash, but could you provide some help about this ?

The article here: https://touchgfx.zendesk.com/hc/en-us/articles/360019884752-Configuring-STM32F746G-DISCO

Only state about the EWARM\stm32f746xx_flash.icf, but the linker file for STM32CubeIDE is totally different, I guess I have to modify STM32F746NGHX_FLASH.ld, but not really sure what to do there.

Also, In your video you seems to let the default configuration for the QSPI, but in the article stated above, the configuration seems a bit different:

0690X000008iYtxQAE.png

When I configure the QSPI like this and generate again, and after I exlude everything related to the simulator, I get a lot of compilation errors:

0690X000008iYu7QAE.png

any ideas ?

Thanks,

Thomas.

Martin KJELDSEN
Principal III
June 12, 2019

Hi Thomas,

I have some ideas. It's getting late so i'll come up with a reply tomorrow. One hint: When you generate code again, CubeMX will actually delete your OSWrapper_cmsis.cpp source file, causing linker errors. You can reinstate that. Also, yes, i did a quick "initialize peripherals in default mode" and did not do any optimizations as per our written guide just to get a working CubeIDE project. Maybe i should have stated that - Thanks for the tip.

/Martin

Thomas Laurenson
Associate II
June 13, 2019

Hi Martin,

You were right OSWrapper_cmsis.cpp was deleted by CubeMX, i had to copy it from a saved project, and also add some paths to the source paths (Middleware and TouchGFX were missing) and managed to get a compiling project again.

Also, i modified the linker script like this:

added:

QUADSPI (r) : ORIGIN = 0x90000000, LENGTH = 16M

ExtFlashSection :

{

*(ExtFlashSection ExtFlashSection.*)

*(.gnu.linkonce.r.*)

    . = ALIGN(0x4);

} >QUADSPI

Now the images go into the ExtFlashSection correctly:

0690X000008iaS0QAI.png

But when i run a session the screen just show rubbish pixels.

not sure if the images are loaded into the external flash, or if the program can work with the external flash correctly.

Thomas.

TMitc
Associate II
July 2, 2019

​Wondering if anyone in this thread has been able to get a similar idea working but on the F769i Discovery board. As of right now there are no published guides or workarounds, so any information would be greatly appreciated.

-Tyler

ALomb
Senior
July 25, 2019

I updated STM32CubeIDE to latest version 1.0.2 (MX Version 5.3.0).

When I run the TouchGFX Designer from MX I still have to change "PostGenerateCommand" item with "echo Test" in the .touchgfx file.

Now, however, leaving the Designer and after generating code from MX all "extra" settings of project are lost.

For "extra" settings I mean project settings changes in linker file for QSPI , include paths related to touch and qspi drivers, output generation in hex format.

Also, to make changes to the GUI using STM32CubeIDE , do I always have to run the designer from MX?

Thanks

/Antonello

ALomb
Senior
July 25, 2019

Forget it.

As described in in Configuring STM32F746G-DISCOVERY:

"It is recommended that the "Execute" action is only performed once during project creation ..."

I tried to open the .touchgfx file directly with the TouchGFX Desiner, made changes and then compiled into STM32CubeIDE. All project settings are unchanged.

Everything works.

Great!!

Martin KJELDSEN
Principal III
August 5, 2019

Hi @Community member​,

Back from vacation. Glad you solved it. The user experience could be improved and we're working on making that happen, slowly :)

gerda.girdz
Visitor II
August 22, 2019

Hi @Martin KJELDSEN​ ,

I was trying to follow the tutorial with the STM32F469 discovery kit. Everything worked fine until the point, where the display (without touch) should work after flashing the target. It deleted the touchGFX project that was on it before, the LEDs turned on, but the display went black.

I took a look at the default device configurations of the discovery kit (in STM32CubeIDE) and it looks like the display size does not match the actual display in the original kit. The size should be 800x480, but is configured as 480x272 and won't let me change it.

Build and debug is ok, it doesn't give me any errors. Do you know anything about this/what the problem might be? I somehow hope that it has something to do with the default device configurations, so the display is not activated correctly but then again I would not know what to do about that either.

Kind regards,

Gerda

scottSD
Senior III
August 22, 2019

I recently went through the same process for the STM32F769-Discovery kit and had a similar result. No compile errors and when debugging to the kit, the screen was black. I have not been able to get it to work, but I was able to change the size. I could edit the X and Y sizes in CubeMX's Middleware > Graphics > Configuration TouchGFX section. Are you trying to edit the size in the TouchGFX section or the "Parameter Settings" section?

0690X00000AA7pBQAT.png

In my case I could edit the sizes in the TouchGFX section but not the "Parameter Settings" section which showed a size of 200x480:

0690X00000AA7pfQAD.png

But like I said, I still couldn't get anything on the Discovery kit's screen (it does work if I create a project in TouchGFX and use it's "Run Target" button).

gerda.girdz
Visitor II
August 23, 2019

Yes, I had tried this before, exactly the same here. I guess we're stuck at the same point.

HP_it
Senior II
August 25, 2019

A user over at youtube asked why the boot-up time was about 10 seconds.

I've found that disabling the MX_ETH_Init call in the start-up can reduce the delay to what we 'usually' see when starting up TouchGFX on a board.

I thought it would be nice to know that if you don't need ethernet connection you can disable this (the 746-Disco board have this on by default) - and save some time

Martin KJELDSEN
Principal III
August 26, 2019

Yeah, there's something in the Ethernet stack that takes an abnormal amount of time to start. I'm not sure when and if that'll be fixed, but if you start from the board selector with default IP configuration then Ethernet will probably be enabled, yea.

I've asked the guy in charge of Youtube to ask users on the channel to ask questions on this forum instead, so it's generally not something i monitor.

Thanks for the heads up.

/Martin

HP_it
Senior II
August 26, 2019

I posted a few answers in there and linked to this article as well :)

HP_it
Senior II
September 10, 2019

I've taken the liberty to do my own videoguide covering the subject of creating a working project in CubeIDE with TouchGFX integrated.

I'm basically doing the same things you do in the video but I try to cut a few corners and talk a bit about some other caveats that exists at the moment. If anyone is interested it's available here:

https://www.youtube.com/watch?v=43qQhrXc3n4

scottSD
Senior III
September 10, 2019

Awesome job, HP!

I appreciate it and can actually make out what you're doing on the video ;)

I hadn't commented out MX_ETH_Init(), so thanks for a heads up on that.

The only thing I would add is that a person might want to change the STM32CubeMX > Connectivity > QUADSPI settings to increase the size to what is available on the board. I ended up running out of space and needed to do that. And of course, as you stated, you only have one chance to generate the IOC file because it really messes things up if you do generate it again.

Here are the settings I used:0690X00000AQz1MQAT.png

 (From the link: https://touchgfx.zendesk.com/hc/en-us/articles/360019884752-Configuring-STM32F746G-DISCO)

HP_it
Senior II
September 11, 2019

Thanks! and thanks for watching through the video and finding even more details I should clarify.

I had the exact problem with the QSPI not working due to the fact that I didn't change the 'default settings'

In another thread (https://community.st.com/s/question/0D50X0000BI1CvjSQF/external-vs-internal-flash-memory-for-touchgfx-assets) I have found those exact settings - so instead of configuring the QSPI during the init of the project I will make another video detailing what to do to get the external flash to work.

I will mention:

  • Sdding an external loader as per Charles suggestions (yet another thread referred in the one above)
  • Setting the right QSPI details - the ones you show in your screenshot above
  • Adding the QSPI driver so it will also work outside the debug environment
  • Showing the build analyzer to show the memory distribution

II hope that a few of those videos will help others as well