cancel
Showing results for 
Search instead for 
Did you mean: 

Black screen with STM32H7A3 LTDC

colin0325
Associate II

I have an STM32H7A3VI that I am using to drive a display.  The display is 24-bit RGB 1024x600 px:  https://download.riverdi.com/RVT70HSTFWN00/DS_RVT70HSTFWN00_Rev.1.2.pdf.  I'm not using TouchGFX or anything fancy, I just want a basic working example of a solid color on the screen.  So far all I've been able to get is a black screen.  I can measure the signals going into the display and everything - HSYNC, VSYNC, Clock, DE and the data bits - all seem normal, but nothing appears on the screen.  I've tested with two displays and get the result, so it's not a problem with the display.  I am wondering if I am missing any sort of configuration that would make all of the pixels go black.

 

Relevant configuration code:

 

LTDC_LayerCfgTypeDef pLayerCfg = {0};

/* USER CODE BEGIN LTDC_Init 1 */
	
/* USER CODE END LTDC_Init 1 */
hltdc.Instance = LTDC;
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
hltdc.Init.HorizontalSync = 1;
hltdc.Init.VerticalSync = 1;
hltdc.Init.AccumulatedHBP = 161;
hltdc.Init.AccumulatedVBP = 24;
hltdc.Init.AccumulatedActiveW = 1185;
hltdc.Init.AccumulatedActiveH = 624;
hltdc.Init.TotalWidth = 1345;
hltdc.Init.TotalHeigh = 636;
hltdc.Init.Backcolor.Blue = 255;
hltdc.Init.Backcolor.Green = 255;
hltdc.Init.Backcolor.Red = 255;
if (HAL_LTDC_Init(&hltdc) != HAL_OK) {
    Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 1024;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 600;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_L8;
pLayerCfg.Alpha = 127;
pLayerCfg.Alpha0 = 127;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg.FBStartAdress = 0x24000000;
pLayerCfg.ImageWidth = 1024;
pLayerCfg.ImageHeight = 600;
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK) {
    Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
for (uint32_t i = 0; i < 0x100; ++i) {
    clut_data[i] = 0x80FFFF00 | i;
}
HAL_LTDC_ConfigCLUT(&hltdc, clut_data, 256, LTDC_LAYER_1);
HAL_LTDC_EnableCLUT(&hltdc, LTDC_LAYER_1);

 

 

3 REPLIES 3
KDJEM.1
ST Employee

Hello @colin0325 and welcome to the Community,

Could you please check the data enable polarity and GPIO speed mode?

The LTDC control signals (HSYNC, VSYNC, DE, and LCD_CLK) polarities must be configured respecting the
display specifications.
Note: Only the DE control signal must be inverted versus the DE polarity indicated in the display datasheet. The other control signals must be configured exactly like the display datasheet.

If the data enable polarity is active high in the datasheet, it must be configured as active low as mentioned in AN4861 in LTDC control signals polarity configuration paragraph.

Also, All GPIOs have to be configured in very-high-speed mode.

Also, I think 7.2.4 LTDC peripheral configuration section in AN4861 can help you.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

colin0325
Associate II

Good catch on the GPIO speed, I had the speed set to the default (low).  Unfortunately that did not fix the problem.  For the polarities, the datasheet specifies:
- Data shall be latched at the falling edge of DCLK
- VSYNC and HSYNC low during the blanking periods and high when pixel data are being sent
- DE is high when pixel data are being sent.

I have HSYNC, VSYNC and DE polarities all set to "Active Low", and Pixel Clock Polarity set to "Inverted Input" (but I've tried "Normal Input" as well).  Is this correct?

colin0325
Associate II

I have made some progress on this issue.  It seems that if I power my board with the ST-Link plugged in, the display does not work, but if I power the board, and then plug in the ST-Link after 3 seconds, it works.  I'm not sharing any pins between the SWD interface and the LTDC, but maybe the presence of the ST-Link at bootup causes problems?  What's even more interesting is that if I program the board, nothing changes.  If it isn't working before I program then it doesn't work after; if it works before I program, it also works after.