cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Graphics Workshop - TouchGFX fail to run Target STM32H7B3I_DISCO

STran.2
Associate II

I follow the instructions in this STM32 Graphics Workshop series and I am able to use STM32CubeIDE to compile the code and run on the target al the ways up to session 11

" STM32 Graphics Workshop - 11 TouchGFX lab LED and buttons "

https://www.youtube.com/watch?v=AaL2xFCgLxY&t=129s

However, when I Run Target from the TouchGFX Designer tool, I get these errors. Note that the methods are implemented and the project works under STM32CubeIDE.

You can find the project and its code here: https://community.st.com/s/feed/0D53W00000OU4kjSAD

--------- ------

    TouchGFX/generated/gui_generated/src/screen2_screen/Screen2ViewBase.cpp:95:20: error: 'class Screen2Presenter' has no member named 'swButtonHwLedToggle'

         presenter->swButtonHwLedToggle();

              ^~~~~~~~~~~~~~~~~~~

    TouchGFX/generated/gui_generated/src/screen2_screen/Screen2ViewBase.cpp:102:20: error: 'class Screen2Presenter' has no member named 'swButtonSwLedToggle'

         presenter->swButtonSwLedToggle();

              ^~~~~~~~~~~~~~~~~~~

    TouchGFX/generated/gui_generated/src/screen1_screen/Screen1ViewBase.cpp: In member function 'void Screen1ViewBase::flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer&)':

    TouchGFX/generated/gui_generated/src/screen1_screen/Screen1ViewBase.cpp:82:20: error: 'class Screen1Presenter' has no member named 'toggleLanguage'

         presenter->toggleLanguage();

              ^~~~~~~~~~~~~~

    gcc/Makefile:326: recipe for target 'TouchGFX/build/STM32H7B3I_DISCO/TouchGFX/generated/gui_generated/src/screen2_screen/Screen2ViewBase.o' failed

    make[2]: *** [TouchGFX/build/STM32H7B3I_DISCO/TouchGFX/generated/gui_generated/src/screen2_screen/Screen2ViewBase.o] Error 1

    make[2]: *** Waiting for unfinished jobs....

    gcc/Makefile:326: recipe for target 'TouchGFX/build/STM32H7B3I_DISCO/TouchGFX/generated/gui_generated/src/screen1_screen/Screen1ViewBase.o' failed

    make[2]: *** [TouchGFX/build/STM32H7B3I_DISCO/TouchGFX/generated/gui_generated/src/screen1_screen/Screen1ViewBase.o] Error 1

    make[1]: *** [generate_assets] Error 2

    gcc/Makefile:293: recipe for target 'generate_assets' failed

    make: *** [all] Error 2

    ../gcc/Makefile:47: recipe for target 'all' failed

    Failed

  Failed

1 ACCEPTED SOLUTION

Accepted Solutions
N. SANTINI
ST Employee

Hi,

Indeed the TouchGFX Designer uses a specific compilation toolchain defined in the "./gcc/Makefile" makefile.

In the lab, in STM32CubeIDE, we added source code that is enabled only if some preprocessor constant are set LAB_STEP_1_ENABLE, LAB_STEP_2_ENABLE, etc. this flags were added, but only in the STM32CubeIDE project.

So you need to add these #define to the Makefile-based built toolchain used by the designer as well.

More precisely application specific compilation flags are not directly in the Makefile but in the ".\TouchGFX\config\gcc\app.mk" which is then imported by the Makefile during build, open this file and update the last line as follow :

user_cflags := -DUSE_BPP=24 -DLAB_STEP_1_ENABLE -DLAB_STEP_2_ENABLE -DLAB_STEP_3_ENABLE 

Last point, in the "./gcc/Makefile" you will see that the path to CubeProgrammer is hardcoded (line 105-106), you will need to update it if you did not use the default installation folder for Cube Programmer (e.g. I put the version in the folder name to keep several versions for support). Otherwise the flashing will not start.

Best regards,

Nicolas

View solution in original post

1 REPLY 1
N. SANTINI
ST Employee

Hi,

Indeed the TouchGFX Designer uses a specific compilation toolchain defined in the "./gcc/Makefile" makefile.

In the lab, in STM32CubeIDE, we added source code that is enabled only if some preprocessor constant are set LAB_STEP_1_ENABLE, LAB_STEP_2_ENABLE, etc. this flags were added, but only in the STM32CubeIDE project.

So you need to add these #define to the Makefile-based built toolchain used by the designer as well.

More precisely application specific compilation flags are not directly in the Makefile but in the ".\TouchGFX\config\gcc\app.mk" which is then imported by the Makefile during build, open this file and update the last line as follow :

user_cflags := -DUSE_BPP=24 -DLAB_STEP_1_ENABLE -DLAB_STEP_2_ENABLE -DLAB_STEP_3_ENABLE 

Last point, in the "./gcc/Makefile" you will see that the path to CubeProgrammer is hardcoded (line 105-106), you will need to update it if you did not use the default installation folder for Cube Programmer (e.g. I put the version in the folder name to keep several versions for support). Otherwise the flashing will not start.

Best regards,

Nicolas