LTDC broken cfg from TouchGFX BSP of CubeMX 5.0.1.. how to debug?
- March 14, 2019
- 3 replies
- 1397 views
hello, i'm testing a simple TouchGFX BSP coming out of the CubeMX 5.0.1 (i know it's not the latest, anyway...)
it's a project "configured" for Atollic Truestudio 6.3. after some tweaks here and there (thanx to a lot of report, online..) i've been able to compile and run it on my STM32F429I-DISC1 dev board. so far so good!
first issue: i had to override the LTDC_ER_IRQHandler() because it was raising the LTDC FUIF (fifo underrun.. maybe it's related to the next issue)
Now i'm facing the "issue" you can see in the attached image, where you can see the Discover board (with a 240x320 display, portrait mode) showing incorrectly the framebuffer. instead of filing the LCD with the full 240x320 Screen, i made in TouchGFX Designer, the graphic is "cut" at two/third, and black on the right side. it looks like an issue about "overdriving" the pixel clock (and that could explain the underrun IRQ before..)
Here the params of the LTDC; where do i find a good set for a check?
void MX_LCD_Init(void)
{
LTDC_LayerCfgTypeDef pLayerCfg;
ili9341_Init();
/* De-Initialize LTDC */
HAL_LTDC_DeInit(&hltdc);
/* Configure LTDC */
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 = 9;
hltdc.Init.VerticalSync = 1;
hltdc.Init.AccumulatedHBP = 29;
hltdc.Init.AccumulatedVBP = 3;
hltdc.Init.AccumulatedActiveW = 269;
hltdc.Init.AccumulatedActiveH = 323;
hltdc.Init.TotalWidth = 279;
hltdc.Init.TotalHeigh = 327;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler( );
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 240;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 320;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
pLayerCfg.Alpha = 255;
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
pLayerCfg.FBStartAdress = 0xD0000000;
pLayerCfg.ImageWidth = 240;
pLayerCfg.ImageHeight = 320;
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler( );
}
HAL_LTDC_SetPitch(&hltdc, 320, 0);
}
maybe somebody has already seen this kind of behaviour.. and it's just an easy fix
