cancel
Showing results for 
Search instead for 
Did you mean: 

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

EUzun.1
Associate

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

3 REPLIES 3
Romain DIELEMAN
ST Employee

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

EUzun.1
Associate

Thank you very much for your answer.

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.