Skip to main content
Associate II
January 5, 2025
Solved

TouchGFX not updating framebuffer. (or not running at all)

  • January 5, 2025
  • 3 replies
  • 1624 views

Im new to TouchGFX. Im goung to create my first demostration on a custom setup.

I got a NUCLEO-L4A6ZG board with a display shield using an MCU interface.

This works:

  • Internal frame buffer 320x240x2 bytes
  • Driver for display, bit banging GPIOs for display control
  • Task that maps the frame buffer to the display periodically.
  • When I alter the frame buffer manually it is is shown correctly on the display.

I have no touch controller on the hardware, expecting to use hardware buttons.

This should have been the hard part. But now I have to get TouchGFX working. I got:

  • Two screens defined in the TouchGFX designer with buttons that alters between the screens.
  • Works on simulator
  • Generates code with no warnings/errors.
  • Everything compiles in STM32MXCube IDE.
  • From the main function MX_TouchGFX_Init and MX_TouchGFX_PreOSInit is called, and returned.
  • A second task calls the MX_TouchGFX_Process which does not return ast it should not.

In the project browser I can see code generated for the screens and the buttons on the screens. And I can verify that the code is actually in the elf-file and flashed to the board.

But:

  • The display is blank. Framebuffer never updaded by TouchGFX.
  • I can see that the MX_TouchGFX_Process is calling os_Delay periodically.
  • The code for the screens is never called.
  • When I open CubeMX from the Cube IDE, I got a warning that TouchGFX 4.24.2 is not found.And I should use Embedded Software Packages updates to fix it. But there is not updates. Cube MX allows me to select TouchGFX 4.24.1
  • When start TouchGFX Designer from the Cube IDE by clicking on the thouchgfx file in the project browser, it starts the designer in version 4.24.2. (Same version if I check in windows Add/remove programs)

So here is the questions:

  • How do I fix the version confusion? Should I care?
  • How do I debug TouchGFX?
  • Is there some kind of status function to call? to see whats going on?

Please give some hints. Thanks in advance.

 

Regards

Leonhardt

Best answer by Leonhardt

Hi Peter

The touchgfxSignalVSync() does not exists in my project for some reson. Maybe because I use "Custom interface" or using FreeRTOS. I therefore copied the function from a demo project and placed it in TouchGFXHAL.cpp. Project compiles. Now display buffer is filled correctly.

Thanks

 

 

3 replies

MM..1
Chief III
January 5, 2025

Optimaly start here Framebuffer Strategies | TouchGFX Documentation

and better is connect display to real peripheral bus . Bitbanging is last resort...

LeonhardtAuthor
Associate II
January 6, 2025

Hi

Framebuffer Strategies | TouchGFX Documentation does not help me. I believe that the configuration from CubeMX is done correctly.

From TouchGFXGeneratedHAL.cpp:

 

void TouchGFXGeneratedHAL::initialize()
{
 HAL::initialize();
 registerEventListener(*(Application::getInstance()));
 setFrameBufferStartAddresses((void*)0x2002A800, (void*)0, (void*)0);
}

 

From TouchGFXGeneratedConfiguration.cpp:

 

Snippets:

#include <platform/driver/lcd/LCD16bpp.hpp>

static LCD16bpp display;

static TouchGFXHAL hal(dma, display, tc, 320, 240);

 

And from my display update task I call my display driver:

void StartDefaultTask(void *argument)
{
 /* USER CODE BEGIN 5 */
 memset((uint8_t *)0x2002A800, 0xFF, 320*240*2);
 for(;;)
 {
 ili9341_WriteDisplayBuffer((uint16_t*)0x2002A800);
 osDelay(100);
 }
 /* USER CODE END 5 */
}

Changing the display buffer by the debugger manually, changes the image on the display as it should. 

Here is my configuration from CubeMX:

Leonhardt_0-1736153162180.png

So I believe that there is something in TouchGFX that is not setup correctly. But I cannot locate the problem as the  TouchGFX is a blackbox.

Kasper

 

ST Employee
January 21, 2025

Hello LeonHardt.

 

Have you filled out the functions in the TouchGFXHAL.cpp file? You e.g. need to call the touchgfxSignalVSync() function every time you want TouchGFX to render a new frame (tick). This is usually done in a LCD Tearing Effect signal interrupt. You can see how it is done in the board setups we deliver in TouchGFX Designer, e.g. for the NUCLEO-C71RB. Hope this can help you forward.

Best regards, Peter

LeonhardtAuthorBest answer
Associate II
January 26, 2025

Hi Peter

The touchgfxSignalVSync() does not exists in my project for some reson. Maybe because I use "Custom interface" or using FreeRTOS. I therefore copied the function from a demo project and placed it in TouchGFXHAL.cpp. Project compiles. Now display buffer is filled correctly.

Thanks

 

 

MM..1
Chief III
January 26, 2025

Yes for custom your code require implement it.

urbito
Senior II
January 21, 2025

I would recommend you to create a bitmap and then create a header file from that bitmap.

Then add it to your project, and check if you are able to see it on LTDC.

Basically, after starting your FMC, on the LTCD init() in the FBStartAdress you instead of pointing to:

pLayerCfg.FBStartAdress = 0xC0000000;

Do something like: 

pLayerCfg.FBStartAdress = (uint32_t)bit_map_name;

Where bit_map_name is the array where the bitmap is placed.

If your hardware is able to show this, then you can continue debugging.

Hope this helps.