Issues with LTDC and Audio Configuration on STM32 - Conflict Between Display and FATFS/Audio Playback (STM32F469i-DISCO
Hi everyone,
I'm encountering a problem with my STM32 project where I need to use both LTDC for display and audio playback (via FATFS). The issue seems to stem from a conflict in clock configurations.
My setup:
MCU = STM32F469i-Disco
The problem
When I configure the clock for LTDC like this:
LTDC clock configuration (stm32469i_discovery_lcd.c line 342):
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
PeriphClkInitStruct.PLLSAI.PLLSAIN = 384;
PeriphClkInitStruct.PLLSAI.PLLSAIR = 7;
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
The display works perfectly, but the audio playback through FATFS fails (specifically in Audioplayer.c at line 42).
However, when I comment out the LTDC clock configuration:
// PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
The audio playback works again, but the display shows an artifact—a black line appears on the screen (as shown in the attached image).
LTDC Timing Configuration:
Timing Configuration:
hltdc_eval.Init.HorizontalSync = (HSA - 1); hltdc_eval.Init.AccumulatedHBP = (HSA + HBP - 1); hltdc_eval.Init.AccumulatedActiveW = (lcd_x_size + HSA + HBP - 1); hltdc_eval.Init.TotalWidth = (lcd_x_size + HSA + HBP + HFP - 1); Initialize the LCD pixel width and pixel height: hltdc_eval.LayerCfg->ImageWidth = lcd_x_size; hltdc_eval.LayerCfg->ImageHeight = lcd_y_size;
My question:
How can I resolve this conflict so that both the LTDC display and audio playback work simultaneously without any artifacts or errors? Is there something wrong with my clock configuration, or is there a better way to manage the clocks for these peripherals?
Any insights or suggestions would be greatly appreciated!
Thanks in advance for your help.
