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
Martin KJELDSEN
Chief III

Hi guys,

Thanks for pinging me @Mon2​. As you've no doubt realized, @njinodra​, there are some quirks. The best thing i can do is pass it on right now, but we could always try to fix your compiler errors together, but clearly the project isn't being generated correctly (undefined references). Even if we do fix the compiler errors, there may be underlying problems.

Let me know what you want to do.

/Martin

Martin KJELDSEN
Chief III

@njinodra​, could you please share your project with me?

I just helped someone else getting their CubeIDE project to compile. I found the following two issues that might also be helpful to know about:

  • The library path was wrong so it couldn't find libtouchgfx-float-abi-hard
  • The post-generate command in the .touchgfx file tries to write to the CubeIDE project file using a script that does not understand the new format. You can wipe this command in the file (you may not be able to leave it empty, just put in something like "echo post gen"). That will allow you to run the simulator through the designer.

If you share your project i will take a look.

Best regards,

Martin

Martin KJELDSEN
Chief III

@njinodra​,

I have a suspicion that you've selected "C" as the project when you started it (Default). This is incompatible with a "Touchgfx" project which is C++.

The three symbols that are undefined come from BoardConfiguration.cpp and i'm preeetty sure that these aren't getting compiled.

Martin KJELDSEN
Chief III

I guess this is one of the "caveats" of an Eclipse based solution. You're most likely using a lot of standard components, but what you'd really want is a way to create a "TouchGFX" project which is then, implicitly, is a C++ project.

Maybe there'll be more cases like this, but it's definitely something we can talk to the CubeIDE team about. It's great to have this kind of real life usage information.

Best regards,

Martin

hansd56
Senior II

When a new project is created in the embedded CubeMX, on the first page either C or C++ can be selected (page where the project name is typed in).

Martin KJELDSEN
Chief III

Check out the new sticky on TouchGFX/CubeIDE.