cancel
Showing results for 
Search instead for 
Did you mean: 

Horizontal glitches on LTDC display during I2C/FRAM transfers with DMA

CiuppaPT
Associate III

 

Hi,
I am working with an STM32F769 MCU driving a 480×272 RGB565 TFT display through LTDC.

Architecture:

  • Framebuffer in external SDRAM (IS42S16800F-7TL, 16 MB) connected via FMC.

  • LTDC + DMA2D used for graphics update (TouchGFX).

  • I²C + DMA used to read/write parameters on an external FRAM.

  • System managed with FreeRTOS.

Problem:
When a long I²C DMA transfer is running (FRAM read/write for parameter storage), I see horizontal glitches on the display: objects temporarily shift to the right (as if some pixels were missing).

The curious part is that the phenomenon only happens if I change the initialization sequence in main() from this:

 

MX_LTDC_Init();
HAL_Delay(1000);  // avoid flickering on display
MX_TouchGFX_Init();
HAL_Delay(200);  // avoid flickering on display
osKernelInitialize();

…to this:

MX_LTDC_Init();
HAL_Delay(1000);  // avoid flickering on display
MX_TouchGFX_Init();
HAL_Delay(200);  // avoid flickering on display
__NOP();   // added
__NOP();   // added
osKernelInitialize();

adding only 2 _NOP();
really can’t explain why just adding, in this init sequence, two NOP  instructions makes the glitch appear.

21 REPLIES 21

Ok, what you have is a generic file but you can refer to any system_stm32f7xx.c used for F769 eval board: Projects\STM32F769I_EVAL\Examples\FMC\FMC_SDRAM\Src\system_stm32f7xx.c

Meanwhile, the MPU background config will prevent that speculative access issue even if that workaround is not implemented in your system_stm32f7xx.c file.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

While we rearrange the MPU_config, adding ...to FMC init

 FMC_Bank1->BTCR[0] = 0x000030d2;

seems to fix the glitch permanently.

For now, thank you very much for your attention.