2021-11-08 01:32 PM
I have STM32H7A3ZIQ Nucleo board and 5" Startek LCD KD050FWFPA011. I'd like to use CubeIDE to create code to copy an image from H7A's flash memory to the LCD using LTDC. I did get STM32H7A3ZIQ Nucleo to work with a 2" LCD using 4-wire SPI interface. The problem I have with 5" LCD is the LTDC interface. Attached is IOC file, CubeIDE code, init code from Startek, scope captures, etc.... Please help.
I got black screen. Backlight is on. IDE reports the image (Mushroom480x800) is defined but not used. Scope captures show 0x00 on pin LTDC_R4. LTDC_CLK is 24MHz, correct as designed. What do I miss?
2021-11-10 07:34 AM
LTDC_IRQHandler(void) is never been called. I've been looking for reason why IRQ is not generated.
From scope captures, VSYNC and HSYNC are generated continuously. RGB data lines are 0x0.
2021-11-10 09:08 AM
Try edit generated part before you understand howto...
static void MX_LTDC_Init(void)
{
/* USER CODE BEGIN LTDC_Init 0 */
/* USER CODE END LTDC_Init 0 */
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_AH;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
hltdc.Init.HorizontalSync = 3;
hltdc.Init.VerticalSync = 3;
hltdc.Init.AccumulatedHBP = 33;
hltdc.Init.AccumulatedVBP = 33;
hltdc.Init.AccumulatedActiveW = 513;
hltdc.Init.AccumulatedActiveH = 833;
hltdc.Init.TotalWidth = 531;
hltdc.Init.TotalHeigh = 853;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 127;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 480;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 800;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
pLayerCfg.Alpha = 255; //!!!
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
//pLayerCfg.FBStartAdress = 0;
pLayerCfg.FBStartAdress = (uint32_t)Mushroom380x600;
pLayerCfg.ImageWidth = 480;
pLayerCfg.ImageHeight = 800;
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 */
/* USER CODE END LTDC_Init 2 */
}
2021-11-10 09:49 AM
2021-11-10 10:01 AM
Check your PCLK DE and SYNC signals polarity with pdf
2021-11-10 10:08 AM
Startek signal names are confusing. So I checked them many times yesterday. Comparing scope capture and Startek pdf (below), it looks right.