Skip to main content
shorai
Associate III
June 1, 2022
Question

Intermittent problem with STM32F746G-Discovery graphics

  • June 1, 2022
  • 3 replies
  • 1165 views

0693W00000Nr0gAQAR.jpgI have an intermittent problem with both TouchGFX and BSP LCD on startup.

I have the same problem on two boards.

Sometimes it starts and displays correctly, sometimes I get a greenish background - see below.

Running LCD_init() again does not clear the problem.

The problem exists from both power up as well as black button reset.

I think it may be a register in the LCD driver that is not being initialised correctly.

void MLX_LCD_Init() {
 
	 	 uint8_t lcd_status = LCD_OK;
	 	 HAL_Delay(500);
	 lcd_status=BSP_LCD_Init();
	 while(lcd_status != LCD_OK) HAL_Delay(10);
 
	 BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_BACKGROUND, LCD_FB_START_ADDRESS);
	 BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_BACKGROUND);
	 BSP_LCD_Clear(LCD_COLOR_BLACK);
	 BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_FOREGROUND, LCD_BG_LAYER_ADDRESS);
 
	 BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_FOREGROUND);
 
	 BSP_LCD_Clear(LCD_COLOR_BLACK);
 
	 BSP_LCD_DisplayOn();
 
	 BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_FOREGROUND);
	 BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
	 BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
	 BSP_LCD_SetFont(&Font16);
 
}

The remainder of trhe project is a standard Cube project fro the 746 Discovery, with LCD_Init() being called at the beginning of startDefautltTask();

Here it works well 5 minutes previously

0693W00000Nr0g5QAB.jpg

This topic has been closed for replies.

3 replies

Uwe Bonnes
Chief
June 1, 2022

on first glance, this looks like a cabling problem. Or maybe some rough part of your program reuses the pins used for the display.

shorai
shoraiAuthor
Associate III
June 2, 2022

Thanks for the quick response.

Probably not so. I did consider hardware problem, but these are factory assembled units and appear to be in good shape.

There is no other part of the program .... it's very simple Cube generated code.

I had some positive progress by adding delays e.g. after clearing the LCD.

There may be issues in sending LCD commands before the previous one has had time to complete.Such a problem could exist either within the chip or the driver.

This makes the process much less responsive as ther are delays all over the place. But at least it seems to work, and I can now tune the delays till the problems recur.

I'll also need to look at the spec for the LCD driver to see if the driver needs to check for 'busy' states (assuming of course that we have access to that information).

heveskar
Senior
March 21, 2024

Hi @shorai,

did you manage to find some definitive fix to this issue? I have a similar problem where the rendering intermittently does not work correctly (not green background but there are some artifacts) after reset. I wondered if the cause may be similar as it was in your case.

Regards,

GaetanGodart
Technical Moderator
March 26, 2024

Hello @shorai ,

 

I have trouble understanding the relation between the written code and TouchGFX.

The STM32F746G-Discovery and his screen seems to be fully supported by TouchGFX.
Indeed, I can find it in Designer when creating a new project :

GaetanGodart_0-1711450481300.png

It means that we have created a TBS allowing users to start Designing their UI without code for initialization.

 

How are you using TouchGFX in your project?

 

Regards,