Skip to main content
ARM_and
Associate III
July 3, 2025
Question

How to debug the touchGFX Engine?

  • July 3, 2025
  • 1 reply
  • 2770 views

On our custom board running STM32U5G7 I have set up a project using the same configurations in the .ioc file of the STM32U5G9J-DK2 but obviously with our pinout and package.

 

The project compiles and runs, it does display correctly on the sim but there is no image on the LCD (I have previously verified the working LCD by writing to the framebuffer in board bring up. (https://support.touchgfx.com/docs/development/board-bring-up/board-introduction). 

I can see with the debugger that the hal.taskEntry() is called. But setting breakpoints in touchGFX designer code such as screen setup does not run.

 

void touchgfx_taskEntry()
{
 /*
 * Main event loop. Will wait for VSYNC signal, and then process next frame. Call
 * this function from your GUI task.
 *
 * Note This function never returns
 */
 hal.taskEntry(); // <-- this line does get executed
}

 

The FreeRTOS wrappers are generated by TouchGFX and I have enabled the relevant interrupts for the LTDC and GPU2D.

How would I go about debugging next steps? Is there a way to monitor the touchGFX engine?


 

1 reply

Lead II
July 4, 2025

At what step did you stop? https://support.touchgfx.com/docs/development/board-bring-up/board-introduction
Can you upload your TouchGFXHAL.cpp?

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
ARM_and
ARM_andAuthor
Associate III
July 5, 2025

Thank you for responding @unsigned_char_array,

Some of the steps are not available for our set up such as external ram or external flash. But the important ones such as DMA2D and internal ram frame buffer work as expected.  See below for the detailed steps. 

 

ARM_and_0-1751720821266.png

 

The TouchGFXHAL.cpp is the stock implementation (attached) since the base class does all the heavy work same way as the DK impl.

I can see the OS Hooks being called, but observing the framebuffer memory in debug shows it to be all black while the screen is supposed to be white (0x0000 vs 0xFFFF).

It would have been nice for the CubeIDE to compile a touchgfxEngine project without first needing the designer and just show a test pattern or something. or other ways of knowing it's running well. I can see beginFrame() being executed but never see flushFrameBuffer() run.


Somehow the framebuffer is not being filled by the touchGFX engine and at this point I have no further recourse on debugging the project.

 

MM..1
Chief III
July 5, 2025

You lacks info. Image with checks is very basic, U5 with GPU is little harder.

Show your main code and MX_LTDC_Init etc... Good to if RTOS used show app_freertos.c

And about debug, you can as normal place breakpoint and ... Primary check if model.cpp func tick is entered...