Showing results for 
Search instead for 
Did you mean: 

Are they version restriction between TGFX and CubeMX ?

Associate III


In the process for learning to use TouchGFX, I encounter a weird issue, confirmed with two different boards and two different TGFX application templates:

When I generate the project with TGFX Designer, import it in CubeIDE, compile it; set the right external flash loader and launch it, it works as expected.

But, if I open the .ioc file with cubeMX (both version: embedded in CubeIDE or standalone) regenerate the code (without upgrading the Cube firmware package version) and launch the software, it run without error but only display the background image but not the text for the first board (32G071) and the animation for the second (32F412).

In addition, If I allow CubeMX to upgrade the firmware package then the project become unusable and can’t compile: the folder containing the HAL (ProjectRoot\Drivers\STM32G0xx_HAL_Driver) is cleared by the upgrade process.

My IDE install is fresh, as the workspace used for those tests

I use :

  •  CubeIDE 1.51 with embedded CubeMX Version: 6.1.1-RC2
  •  CubeMX standalone 6.11
  • TGFX 4.16
  • For board 1 (simple): NUCLEO G071 + XNUCLEO FGX01M1, the corresponding TGFX App (local not online as they are not the same), the Blank UI customized with one screen, one box and one TextArea. The TGFX Cube Version is 1.3, when I upgrade it become 1.4.
  • For board 2 : 32F412GDISCOVERY and the corresponding v3.0.3 template of TGFX.

Am I missing something ? I only do very basic and standards action. Are they version limitations between TGFX, CubeMX and Firmware packages ?



Chief III


If a flashloader isn't configured then, yeah, no text (default placed in external flash for boards where that's possible).

We don't always update Application templates to support the latest of all tools (cubeMX version, CubeFW packs version, for instance) all the time.

Can you show me the errors when CubeMX upgrades the drivers? If there are any bugs in that process i've got a direct link to the team 🙂

There shouldn't be any "limitations". The Application templates may have an ioc file from 6.0.1 which requires migration to 6.1.1 or similar but there should be no issues. If you find any just contact me.

For the case where you're not seeing text or images (button) can you verify the flashloader settings?


ST Employee

EDIT: answered to this message without seing Martin's.


I was able to face issues as well when replicating your steps with the Nucleo G071. Could you still share screenshots of the issues you faced in order to make sure they are the same ?


Associate III

Hi Martin and Romain,

I made some tests last night, focused on the simple setup: NUCLEO_G071 + XNUCLEO_GFX01 using TGFX 4.16.

The TGFX test project I use for testing has 5 widgets: a Box, a ButtonWithLabel, a Shape, a toggleButton and an Image. I think that fonts (for the button with a label) and Image are by default stored on the external flash. I use the Designer local template with blank UI, not the online one.

I can confirm flasher loader is the right one and is ok: I can read the external flash with Cube Programmer and the clean projects coming from TFGX Designer behave as expected (after changing the .stldr because default flash is a Cypress one and the GFX01 board is equipped with a Macronix) : the 5 widgets are displayed.

I rolled back CubeMX to 6.01 and got the same issue than the one described initially: If I open the .ioc file with cubeMX, change nothing and regenerate code, then compile the project, the image widget won’t display and the text on the ButtonWithLabel widget also won’t display. As suggested that seems to be a flash access issue. There’s no build or error runtime at all.

Then I ran a file compare between clean project from TGFX and project regenerated by CubeMX. Except date and some explainable changes, I noticed changes in TGFX cpp code related to Datareader access (the external flash) :

TGFX produce a \project_root\ TouchGFX\target\generated\TouchGFXGeneratedDataReader.cpp file which is modified by the regeneration by Cube MX. Two functions in particular:

  • void TouchGFXGeneratedDataReader::copyData(const void* src, void* dst, uint32_t bytes), and
  •  void TouchGFXGeneratedDataReader::startFlashLineRead(const void* src, uint32_t bytes).

To make short, copying the original TouchGFXGeneratedDataReader.cpp in the CubeMX regenerated project solve my issue and allows the 5 widgets to be correctly displayed. The two versions of the file are attached.

I’ll later try to confirm with CubeMX6.11 then with 1.40 firmware.


Associate III

Hi Martin and Romain,

I done some more tests today;  conclusions:

First bug :

Modifying with CubeMX (6.01 or 6.11) a TGFX project (4.16), without any Cube FirmWare upgrade, also modify the TGFX code (file TouchGFXGeneratedDataReader.cpp) and prevent TGFX software to access the external flash.

Romain, have you been able to reproduce the issue ?, Martin, is there a plan to fix this if the case is confirmed ?

Second bug :

Upgrading with CubeMX a TGFX project from G071 FW1.30 to FW1.40 cause the following compile errors :

C:/Users/XXXX/OneDrive/Documents/Atollic/TouchGFXProjects/Clean_G071_GFX01/Core/Src/system_stm32g0xx.c:235:10: error: 'RCC_CFGR_SWS_LSI' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_HSE'?

    case RCC_CFGR_SWS_LSI: /* LSI used as system clock */



C:/Users/XXXX/OneDrive/Documents/Atollic/TouchGFXProjects/Clean_G071_GFX01/Core/Src/system_stm32g0xx.c:239:10: error: 'RCC_CFGR_SWS_LSE' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_LSI'?

    case RCC_CFGR_SWS_LSE: /* LSE used as system clock */



C:/Users/XXXX/OneDrive/Documents/Atollic/TouchGFXProjects/Clean_G071_GFX01/Core/Src/system_stm32g0xx.c:243:10: error: 'RCC_CFGR_SWS_PLL' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_Pos'?

    case RCC_CFGR_SWS_PLL: /* PLL used as system clock */



C:/Users/***/OneDrive/Documents/Atollic/TouchGFXProjects/Clean_G071_GFX01/Core/Src/system_stm32g0xx.c:264:10: error: 'RCC_CFGR_SWS_HSI' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_LSI'?

    case RCC_CFGR_SWS_HSI: /* HSI used as system clock */



Those errors seems not being related to TGFX but the firmware upragde from 1.3 to 1.4 as they are already identified by ST staff in some thread.

I suppose we have to wait for FW1.4.1

Thanks for your help,


Associate II

I also have the 2 bugs, working on STM32G071 Nucleo, with TouchGFX Designer v4.16/v4.16.1, STM32CubeMX v6.2.0 and STM32CubeIDE v1.6.0. And firmware STM32Cube_FW_G0_V1.4.1/V1.3. When regenarating the code and then flashing the nucleo there are no text displayed. I started my project with a blank template from TGFX for this nucleo. This bug i haven't been able to solve, so I have been working now with TGFX v4.15 with no problem.


I am actually working on it right now as well. While we implement the fix I would advise to keep using TouchGFX 4.15, CubeMX 6.1.1 and the FW package 1.3.0.

If you cannot wait for a fix and really need to use the latest tools I can give the current workaround but it needs more investigations.

The main issue was first with the FW package 1.4.0 and 1.4.1 (the RCC issues). To fix it you need to replace the system_STM32G0x.c file in the core/src folder by the same file you can find in the FW package 1.4.1 in (usually) the folder <username>/STM32Cube/Repository/STM32Cube_FW_G0_V1.4.1 in one of the projects.

The second issue (the text) seems to come from a change in TouchGFX Generator from TouchGFX 4.15 and 4.16 for the STM32G0. If you compare the functions generated in TouchGFXGeneratedDataReader.cpp (in the <projectFolderName>/TouchGFX/target/generated folder) with the two versions you will see that there has been an update of the copyData() and startFlashLineRead() functions. To fix the issue you need to "revert" the function to what they were in 4.15, so the following code:

void TouchGFXGeneratedDataReader::copyData(const void* src, void* dst, uint32_t bytes)
  /* Redirect copy data through driver interface */
  DataReader_StartDMAReadData((uint32_t)src, (uint8_t*)dst, bytes);
  /* Wait on data transmision complete */
void TouchGFXGeneratedDataReader::startFlashLineRead(const void* src, uint32_t bytes)
  /* If requested number of bytes are less than 40
   * CPU and polling will be used to read from flash.
   * If number of bytes requested is larger than 40
   * a DMA transfer will be started.
  if (bytes < 40)
    /* Start transfer using the CPU */
    DataReader_ReadData((uint32_t)src, (readToBuffer1 ? buffer1 : buffer2), bytes);
    /* Start transfer using DMA */
    DataReader_StartDMAReadData((uint32_t)src, (readToBuffer1 ? buffer1 : buffer2), bytes);


Associate II

Ok, thanks it is working now, but now I have another problem. So, when flashing from TGFX Designer it Flash ok with no compiling error. But when I try to laucnh from CubeIDE the following errors for setRange and getRange apear...

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/generated/Demo1ViewBase.o: in function `Demo1ViewBase::Demo1ViewBase()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.0/TouchGFX/generated/gui_generated/src/demo1_screen/Demo1ViewBase.cpp:22: undefined reference to `touchgfx::AbstractProgressIndicator::setRange(int, int, unsigned short, unsigned short)'


The error messages indicate that you are using the FW package 1.3.0, is it the case or are you using the v1.4.1 ? If you are using the latest one maybe try to regenerate code from CubeMX, then regenerate code from TouchGFX Designer. Then "clean" the CubeIDE project (I think you have to right click on the name of your project in the tree view on the left) and finally press "build".


Associate II

Yes, I am using 1.4.1. Tried to regenerate, cleand and build, but same errors showed up. This was trying to update a project from TGFX 4.15 to 4.16.1.


c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/generated/Demo1ViewBase.o: in function `Demo1ViewBase::Demo1ViewBase()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/generated/gui_generated/src/demo1_screen/Demo1ViewBase.cpp:22: undefined reference to `touchgfx::AbstractProgressIndicator::setRange(int, int, unsigned short, unsigned short)'

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/generated/Demo2ViewBase.o: in function `Demo2ViewBase::Demo2ViewBase()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/generated/gui_generated/src/demo2_screen/Demo2ViewBase.cpp:22: undefined reference to `touchgfx::AbstractProgressIndicator::setRange(int, int, unsigned short, unsigned short)'

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/generated/Demo3ViewBase.o: in function `Demo3ViewBase::Demo3ViewBase()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/generated/gui_generated/src/demo3_screen/Demo3ViewBase.cpp:21: undefined reference to `touchgfx::AbstractProgressIndicator::setRange(int, int, unsigned short, unsigned short)'

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/generated/gui_generated/src/demo3_screen/Demo3ViewBase.cpp:30: undefined reference to `touchgfx::AbstractProgressIndicator::setRange(int, int, unsigned short, unsigned short)'

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/gui/Demo1View.o: in function `Demo1View::setupScreen()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/gui/src/demo1_screen/Demo1View.cpp:11: undefined reference to `touchgfx::AbstractProgressIndicator::getRange(int&, int&) const'

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/gui/Demo2View.o: in function `Demo2View::Demo2View()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/gui/src/demo2_screen/Demo2View.cpp:6: undefined reference to `touchgfx::AbstractProgressIndicator::getRange(int&, int&) const'

c:\development\st\stm32cubeide_1.2.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: Application/User/gui/Demo3View.o: in function `Demo3View::setupScreen()':

C:/Development/Projectes/STM32G071_NUCLEO_Touchgfx_v4.15_to_v4.16.1_FWv1.4.1_Uart_notworkcubeide/TouchGFX/gui/src/demo3_screen/Demo3View.cpp:11: undefined reference to `touchgfx::AbstractProgressIndicator::getRange(int&, int&) const'

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:84: STM32G071_NUCLEO.elf] Error 1

"make -j4 all" terminated with exit code 2. Build might be incomplete.