Skip to main content
Associate II
September 8, 2025
Question

TouchGFX with Zephyr RTOS on STM32H745

  • September 8, 2025
  • 4 replies
  • 2734 views

Hi Community,

We are exploring the migration of our FreeRTOS-based firmware to Zephyr. Our current design heavily relies on TouchGFX (provided by ST) for controlling an 800×480 touch display.

Here are some key details of our setup:

  • TouchGFX with external SDRAM for a double frame buffer using the FMC peripheral
  • Images, fonts, and text stored in external QSPI Flash
  • LTDC controller in use
  • DMA2D accelerator enabled
  • RGB image compression utilized

Is there any sample application or detailed documentation available for achieving this on Zephyr?

I have already briefly reviewed the following resources:

However, I need more guidance, specifically:

  • Examples or reference projects for TouchGFX on Zephyr
  • Detailed documentation on integration steps

We have a tight project deadline, so I need to quickly determine:

  1. Whether TouchGFX can work with Zephyr
  2. How complex the migration effort would be

Any insights, references, or experiences would be greatly appreciated.

Regards,
Devanshu Agarwal

4 replies

ST Employee
September 8, 2025

We have internal proof of concept of this, and are working towards a way to handle documentation and release of an example project or two.

At the same time, Zephyr is not a supported target for TouchGFX, so there will be some things we cannot help you with here.

I will check if we can share one of the proof of concept projects at this stage.

The simplest way to get your setup to work should be to get the QSPI flash memory and maybe your FMC RAM mapped in Zephyr, and handle the rest of the peripherals you listed in the STM32Cube driver port for Zephyr. You will need to do the LTDC this way to be able to register an interrupt handler, and for DMA2D there is no Zephyr interface.

You will need to enable the specific driver files you need to include as Zephyr modules and disable the peripherals from device tree, and then you should be able to copy the code from your old main.c into the zephyr main.c, along with relevant code for each peripheral from you hal_msp.c file.

You will also need to register some interrupt handlers(LTDC and DMA2D, at least), they should just call the HAL interrput handler, just like the _it.c file from your CubeMX project does, then TouchGFX will either override the callback or register a callback function to them.

When all the peripherals are enabled, you can copy your entire TouchGFX folder from your old project into the Zephyr project. You will need to create a Cmakelist.txt for TouchGFX and include that in your Zephyr application.

You can enable a CMSIS wrapper in Zephyr, this will enable you to reuse your oswrapper file from your FreeRTOS project. Main should start a thread that calls TouchGFX_Task().

There is a bit too much to detail here, and I'm not sure it would be all that easy to glean all of it from an example project anyway, since it will always be a somewhat weird mix of a Zephyr project that has been massaged to be able to fit a TouchGFX project inside.

I will try to get a project cleared for sharing with you, but the first step should be to get your peripherals initialized and confirmed working in Zephyr. Even with the example project there will be details that I have forgotten, but I will try to help to the best of my ability.

devanshu5Author
Associate II
September 9, 2025

Thank you for the prompt response and clear explanations. It would be greatly appreciated if you could share the project with us. We'd like to quickly test, modify, and validate it on an evaluation/development kit to better understand the porting efforts.

ST Employee
September 10, 2025

I will be able to share a proof of concept project for the STM32U5G9J-DK2 discovery kit, but I will need to make some small changes and cleanup before it is ready for sharing. I will try to prioritize this task as soon as possible.

In the mean time you could consider acquiring the board if you want to be able to run the sample project.

ST Employee
September 18, 2025

Here's the project for the U5G9-DK2.

It should be placed in a Zephyr workspace and can be built with west build -b stm32u5g9j_dk2 app --pristine auto from the root of the project. Flash using west flash. Alternatively, the run target button in the TouchGFX designer builds and flashes automatically. External memory is supported, and an external loader is supplied and used by west flash.

The LTDC, CRC, DMA2D and GPU2D are initialised using STM32 HAL code, all other peripherals including the touch screen is handled in device tree.

The LTDC can also be initialised using device tree, it is disabled in board overlay, but the display driver captures the line interrupt which is needed by TouchGFX. I'll work on a solution to this before publishing the final project and documentation, but this works well for now.

Have a look at prj.conf, there are some things that are crucial for the project to work there.

devanshu5Author
Associate II
September 19, 2025

Hi,

Thanks for sharing the sample project and steps. We will refer to it and make changes for our STM32H7 dev board. I will reach out to you if we need further help. Thanks again.

Regards,

Devanshu Agarwal

ST Employee
December 3, 2025

Hello,

Did you do any modifications to the project, or did you just build for a different board?

I have hardware available to test it, so can you share your project, if you have modified it?

devanshu5Author
Associate II
December 3, 2025

I made several modifications to get it working on the STM32H745.
Could you please share your email address? I’ll send you the project via email and also include the other ST members I’ve been in touch with.

Jazman
Associate III
January 7, 2026

devanshu5 - Are you able/willing to share your project for the STM32H745?  It would be awesome to use this as a learning/starting point to see how you integrated TouchGFX with Zephyr.

THANK YOU IN ADVANCE!

Keith

Jazman
Associate III
January 5, 2026

All - I am also very interested in this subject.  I had started a thread back in 2024 asking about Zephyr and TouchGFX integration but didn't really get any assistance.  I've used TouchGFX on multiple projects and it's great.  But, we're really looking to go with Zephyr for the OS because of the other things it brings to the party (ie: IP stack for example).  I know many companies are moving forward with Zephyr as well.

My 2024 thread: https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/zephyr-and-touchgfx/td-p/674902

I do have an STM32H747I-DISCO board.  This is very similar to the 745 with additional hardware and dual core.

Would love any information you'd be willing to share.  Would also love to see ST officially make support for Zephyr available.  I realize you probably can't make it part of the Zephyr distribution since it's ST part specific, but having instructions on how ST customers can use ToughGFX with Zephyr would be grand!

 

Thanks in advance!