cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly configure device with TouchGFX enabled in STM32CubeIDE?

njinodra
Associate

I am trying to use STM32CubeIDE for with STM32F429i DISC1 for generating code with TouchGFX enabled in Device configuration tool. I have configured Touchgfx options as shown below.0690X000008B6yRQAS.jpg

After clicking EXECUTE button in touchgfx tab, touchgfx window opens.

In touchgfx, while trying to Generate code I am getting error. I have attached output_PostGenerate.log file

After closing TouchGFX, when i am trying to build project i am getting following errors.

18:48:16 **** Incremental Build of configuration Debug for project T2 ****

make -j4 all

arm-none-eabi-gcc "../Src/stm32f4xx_it.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32F429xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/BSP/Components/exc7200 -I../Drivers/BSP/Components/ts3510 -I../Drivers/BSP/Components/stmpe811 -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../TouchGFX/generated/texts/include -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Src -I../TouchGFX/generated/images/include -I../Drivers/BSP/Components/ili9341 -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Inc -I../Drivers/CMSIS/Include -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Drivers/BSP/Components/Common -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/BSP/Components/ampire480272 -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/stm32f4xx_it.d" -MT"Src/stm32f4xx_it.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/stm32f4xx_it.o"

arm-none-eabi-gcc -o "T2.elf" @"objects.list"  -mcpu=cortex-m4 -T"C:\work\T2\STM32F429ZITX_FLASH.ld" --specs=nosys.specs -Wl,-Map="T2.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

Startup/startup_stm32f429zitx.o: In function `LoopFillZerobss':

C:/work/T2/Debug/../Startup/startup_stm32f429zitx.s:113: undefined reference to `main'

Src/stm32f4xx_it.o: In function `LTDC_IRQHandler':

C:/work/T2/Debug/../Src/stm32f4xx_it.c:205: undefined reference to `hltdc'

Src/stm32f4xx_it.o: In function `DMA2D_IRQHandler':

C:/work/T2/Debug/../Src/stm32f4xx_it.c:219: undefined reference to `hdma2d'

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:51: T2.elf] Error 1

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

18:48:20 Build Failed. 4 errors, 0 warnings. (took 3s.477ms)

15 REPLIES 15
Mon2
Senior III

Been there, done that, bought the t-shirt and wrote a book:

https://s3.amazonaws.com/axxonshare/my_combo_tutorial.zip

Actually, he's asking how to get TouchGFX and STM32CubeIDE to play nice together. Not IAR or SW4STM32.

scottSD
Senior III

I get the same errors (except TouchGFX, which generates without errors) when trying this with the STM32F746 Discovery kit.

hansd56
Senior II

Unfortunately, I can not provide an answer. I have tried it with the STM32F746 Discovery kit and STM32CubeIDE. Many compile errors. There is still some work needed for a smooth TochGFX solution with STM's provided tools. But it looks promising. It would be nice to include STM32CubeIDE in the documentation for TouchGFX since both are STM tools.

Mon2
Senior III

Hi @hansd56​ . The resolution is not fun at this time but should work. Please review the following process for your target STM32F746 Discovery Kit.

1) You should (must) use IAR compiler at this time. If not then you will face yet more hurdles and may not have a working solution in then end.

2) Launch the latest TouchGFX toolchain.

3) Select your target kit. Before creating a fresh new project, select the Template version and scroll to V2.0.0. You are fortunate that ST has released a V2.0.0 version of the template which will save a great deal of time.

4) Build your GUI artwork. Test that it works by compiling / simulating, etc on your target hardware.

5) After being satisfied all is well, manually browse the folder with the source code for this wizard generated project. Locate the .IOC file which is the link to the CubeMX IDE tool.

6) Launch the CubeMX and insert what you wish but recommend to disturb nothing at the first review of this process. Proceed to use the IAR in the project definition inside of CubeMX. Generate the Code using the supplied button.

7) Now IAR prompt to launch should be available. Proceed to do so and compile away. The code should be now broken as that is a well known issue.

😎 To fix the source code, you must, every time, review the process to fix IAR code from here:

https://community.st.com/s/question/0D50X0000A7VYsCSQW/guides-for-using-touchgfx-410-with-cubemx-50-known-limitations

and specifically:

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

So to summarize again:

Launch TouchGFX first. Select v2.0.0 template (only) for your target kit. Build you GUI.

Launch CubeMX manually through the generated .IOC file -> insert your CubeMX stuff -> Generate code. Now the project will break due to whatever reasons.

Fix the broken IAR code following the IAR process here:

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

Each time you use CubeMX with this kit, the code will break so rinse and repeat.

Hope this helps.

Please post your results after testing.

Mon2
Senior III

@njinodra​ , what are your tool versions for both, the CubeMX and TouchGFX?

Are the results the same if following our article or this process from ST?

https://touchgfx.zendesk.com/hc/en-us/articles/360021620431-Configuring-STM32F429I-DISCO

hansd56
Senior II

Hi Mon2, I am using TouchGFX 4.10 and STM32CubeIDE 1.0.0. I did get in the end the programmed background with a button displayed. There were some BSP files missing and some paths. I removed the Simulator part. Once it compiled and linked if worked except the touch screen. I am going to create the project again and try to leave the Simulator part. I recon this will be needed to run the simulation in the TouchGFX Designer when designing the front end. I'll post the code once I am done.

@Mon2​ , I am using STM32CubeMX V5.2.0, SW4stm32_win_64bits-v2.9, and TouchGFX V 4.10.0. After following your procedure I am successfully able to build code using STM32CubeMX and SW4STM32. But same procedure is not working in STM32CubeIDE. I thing problem is due to disabled (and Ticked) option of Generate under Root in Project Manager of STM32CubeIDE. Anyway lets use STM32CubeMX and SW4STM32 till this problem gets resolved in future versions of STM32CubeIDE. Right now I am able to use 4.3 inch external display on STM32F429i DISC1. Thanks.

Mon2
Senior III

@hansd56​ , @njinodra​ , thanks. I now feel embarrassed to say that did not know about the new STM32CubeIDE tool so out of the loop. Will review perhaps this new tool over the weekend but another engineer here reported that it was released recently and is the integration of CubeMX with Atollic compiler?

Yeah!! More stuff to learn.

If possible, best to follow the posted solutions using the IAR or SW4STM32 toolchain. From last review, the Keil and Atollic compilers were still not mature (immature?) for use. Now just received an alert from ST for a pending TouchGFX seminar for 4.11 release - wonder if they have fixed some of the many raised quirks.

Welcome to beta test - hint to @Martin KJELDSEN​  =)

@hansd56​ , on the touch screen support - please review the procedure from our posted document above in this thread - perhaps it will help you as well.

Any of your feedback is welcomed here in the forum for future readers.

Bye for now.