Black screen with STM32H7A3 LTDC
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);
