Skip to main content
AFire.1
Associate
June 2, 2021
Question

F746G Discovery: dark grey screen caused by MX_TouchGFX_Init()

  • June 2, 2021
  • 3 replies
  • 1486 views

Hi,

I wanted to configure my F746G Discovery board with LTDC and TouchGFX using framebuffer in internal RAM from scratch. So I configured LTDC based on scheme provided and it works perfectly fine. I am able to display and switch solid colors, display static image from .h file.

Then I wanted to make TouchGFX work, but after calling MX_TouchGFX_Init() it will just display dark grey screen, without calling it I can display at least static content normaly.

LTDC_IRQHandler is being called periodically and framebuffer is declared and set this way:

uint16_t framebuffer[480*272];

HAL_LTDC_SetAddress(&hltdc, framebuffer, LTDC_LAYER_1);

Something is probably miss-configured with TouchGFX and I can´t figure out what it is. Thanks for any help!

This topic has been closed for replies.

3 replies

Romain DIELEMAN
ST Employee
June 3, 2021

Hi,

In the TouchGFX configuration you have not set a StartAddress for the framebuffer, so the setFramebufferStartAddresses() function in TouchGFXGeneratedHAL.cpp in the TouchGFX/target/generated folder will not work.

/Romain

AFire.1
AFire.1Author
Associate
June 3, 2021

Thank you for reply, I solved it with following code in main:

__attribute__ ((section(".TouchGFX_Framebuffer"), used))

uint32_t framebuffer[400*200];

However this is working without OS, with CMSIS OS, this is not working for some reason.

Do you have any idea how to refer to framebuffer placed in internal memory using OS? Thank you!

Romain DIELEMAN
ST Employee
June 4, 2021

by the way for the framebuffer I would suggest to allocate Width*Height*bpp/8 instead of just Width*Height