cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX with Zephyr RTOS on STM32H745

devanshu5
Associate II

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

1 REPLY 1
mathiasmarkussen
ST Employee

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.