Skip to main content
EUzun.1
Associate
March 4, 2021
Question

How to link framebuffer address in CubeMX and TouchGfx when using internal memory?

The MCU is STM32H743. In CubeMX LTDC settings, I have set the framebuffer address as 0x3000000, and selected buffering strategy and buffer location as "Single" and "Allocate" respectively inb TouchGfx. Also, in main.c I've declared an array

uint16_t framebuffer[100*100];

and set the framebuffer address to this array with

HAL_LTDC_SetAddress(&hltdc, framebuffer, LTDC_LAYER_1);

The display is 640x480, and all that is shown in the display is the backgorund color and a 100x100 black square.

I suspect the framebuffer addess is not understood by TouchGfx. What can I do correctly link the two framebuffer address?

Thanks,

E

This topic has been closed for replies.

3 replies

Romain DIELEMAN
ST Employee
March 5, 2021

Hi,

The function setFrameBufferStartAddresses() in TouchGFXGeneratedHAL.cpp in the TouchGFX/target/generated folder might be what you are looking for. You can overwrite this function in the TouchGFXHAL::initialize() function in TouchGFXHAL.cpp to be sure that your framebuffer is at the right address if you wish as well.

By the way I believe the framebuffer should be Width * Height * Bpp/8 rather than what you have put.

/Romain

MMiim.1
Visitor II
December 23, 2021

As the buffer has been defined "uint16_t", it would be enough to say [W*H] only for rgb565, which needs 2 bytes for each pixel.

EUzun.1
EUzun.1Author
Associate
March 7, 2021

Thank you very much for your answer.