cancel
Showing results for 
Search instead for 
Did you mean: 

LTDC FIFO Underrun occurs on STM32H745XI with Emwin 24bit RGB

JPate.2
Associate II

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.

7 REPLIES 7
MM..1
Chief II

try slow down LTDC clock

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?

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)

Reduced LTDC Clock frequency to 30 MHz Still gettings the same problem.

Although Frequency of flickering reduced so will try reducing LTDC Clock further.

Might also want to look critically at the SDRAM timing, whether that is cached/buffered, and what kind of contention you have on it.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MM..1
Chief II

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 II

@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?