Skip to main content
JPate.2
Associate
December 31, 2020
Question

LTDC FIFO Underrun occurs on STM32H745XI with Emwin 24bit RGB

  • December 31, 2020
  • 7 replies
  • 2084 views

Hello,

I'm using STM32H745XI based custom board running at 480MHz.

Interfaced SDRAM in 32 bit mode.

Using RGB 24 -bit interface to connect to TFT Displays.

Setup Emwin in ARGB8888 Mode.

Functional memory map is like below.

LTDC Configured as Single layer 800x480 Display.

Frame buffer in sdram [ Using 2 Buffers in Emwin].

Emwin objects data are in AXI RAM at 0x30000000 for 256 Kb

Using FreeRTOS so configured stack and heaps in DTCM ram.

Placed Vector table and ISR routines in ITCM ram.

Configured MPU for 2 Regions.

0x30040000 - 64Kb [ Share,No-cache,No-Buffer,MPU_INSTRUCTION_ACCESS_ENABLE,TEX0 ]

0xC0000000 - 16Mb [ No-Share,Cache,Buffer,MPU_INSTRUCTION_ACCESS_DISABLE,TEX0 ]

Works fine but sometimes it genereates FIFO Underrun error HAL_LTDC_ERROR_FU Error And Program stucks.

How to troubleshoot this issue.

Do i need to configure any other MPU regions.

Any clue will be helpful.

Thanks.

This topic has been closed for replies.

7 replies

MM..1
Super User
December 31, 2020

try slow down LTDC clock

JPate.2
JPate.2Author
Associate
January 1, 2021

LTDC Clock was running at 40 MHz.

My TFT Requires typical 40 MHz Dot Clock.

Here is my TFT Timing.0693W000006HIqIQAW.pngHere is the timing values i've programmed.

#define VSYNC 3
#define VBP 29
#define VFP 13
#define VACT 480
 
#define HSYNC 48
#define HBP 40
#define HFP 40
#define HACT 800
 
 hltdc.Init.HorizontalSync = (HSYNC - 1);
 hltdc.Init.VerticalSync = (VSYNC - 1);
 hltdc.Init.AccumulatedHBP = (HSYNC + HBP - 1);
 hltdc.Init.AccumulatedVBP = (VSYNC + VBP - 1);
 hltdc.Init.AccumulatedActiveH = (VSYNC + VBP + VACT - 1);
 hltdc.Init.AccumulatedActiveW = (HSYNC + HBP + HACT - 1);
 hltdc.Init.TotalHeigh = (VSYNC + VBP + VACT + VFP - 1);
 hltdc.Init.TotalWidth = (HSYNC + HBP + HACT + HFP - 1);
 
 /* background value */
 hltdc.Init.Backcolor.Blue = 0;
 hltdc.Init.Backcolor.Green = 0;
 hltdc.Init.Backcolor.Red = 0; 
 
 /* Polarity */
 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.Instance = LTDC;
 
 HAL_LTDC_Init(&hltdc);
 HAL_LTDC_ProgramLineEvent(&hltdc, 0);
 

Is there anything that i can try?

MM..1
Super User
January 1, 2021

No your LCD define only MAX and TYPICAL and no MINIMAL value, you can use any freq up to 50, but

speed need corelate with MCU. Then try slow down LTDC clock for example -5%. 8)

MM..1
Super User
January 2, 2021

Memory and bus configure to maximum throug and too try place Frame buffer in sdram [ Using 2 Buffers in Emwin]

starting address to bank start addresses example first buf C0000000 second C0200000 when your bank start here...

RRaj.1
Associate
December 9, 2021

@JPate.2​ We are in the same boat. Did you find any resolution for the problem?

@MM..1​  @Community member​ Can we increase the clock speed of SDRAM to avoid this issue?