AnsweredAssumed Answered

STM32F429 LCD Flickering

Question asked by Kwon YM on Feb 27, 2018
Latest reply on Feb 27, 2018 by Vitaliy Chernobay

I use STM32F429 witch display on 7inch LCD

 

This board's status was normal after display rectangle.

 

but something has problem during display rectangle with some flickering.

 

It has problem that use DMA2D or direct rambuffer too.

 

LCD model is "at070tn94" 800*480

 

<Movie clip>

KakaoTalk_Video_20180227_2056_13_598.mp4 - Google Drive 

 

<Main>

HAL_Init();

/* USER CODE BEGIN Init */

/* USER CODE END Init */

/* Configure the system clock */
SystemClock_Config();

/* USER CODE BEGIN SysInit */

/* USER CODE END SysInit */

/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_FMC_Init();
MX_LTDC_Init();
MX_RTC_Init();
MX_USB_OTG_FS_USB_Init();
MX_SPI2_Init();
MX_DMA2D_Init();
MX_I2C2_Init();
MX_TIM3_Init();
MX_CRC_Init();

/* USER CODE BEGIN 2 */
// Program the SDRAM external device
SDRAM_Initialization_Sequence(&hsdram2, &command);
HAL_Delay(200);

 

//LCD GPIO
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, GPIO_PIN_SET); //BACK LIGHT
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_6, GPIO_PIN_SET); //L_MODE
TP_CS_H;

for(testdma=0; testdma < 100; testdma++) {
HAL_Delay(500);
DMA2DFillBuffer(glCurrentLayer, glCurrentFrameBuffer, rand()%800, rand()%480, rand()%100, rand()%100, rand()%0xFFFFFF, DMA2D_RGB565);
}

 

<LCD setting>

LTDC_LayerCfgTypeDef pLayerCfg;
LTDC_LayerCfgTypeDef pLayerCfg1;

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 = 45;
hltdc.Init.AccumulatedVBP = 22;
hltdc.Init.AccumulatedActiveW = 845;
hltdc.Init.AccumulatedActiveH = 502;
hltdc.Init.TotalWidth = 895;
hltdc.Init.TotalHeigh = 525;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}

pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 800;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 480;
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 = 800;
pLayerCfg.ImageHeight = 480;
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}

pLayerCfg1.WindowX0 = 0;
pLayerCfg1.WindowX1 = 800;
pLayerCfg1.WindowY0 = 0;
pLayerCfg1.WindowY1 = 480;
pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
pLayerCfg1.Alpha = 0;
pLayerCfg1.Alpha0 = 0;
pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
pLayerCfg1.FBStartAdress = 0xD0000000 + 0xbb800;
pLayerCfg1.ImageWidth = 800;
pLayerCfg1.ImageHeight = 480;
pLayerCfg1.Backcolor.Blue = 0;
pLayerCfg1.Backcolor.Green = 0;
pLayerCfg1.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, 1) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}

Outcomes