cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767 LTDC dual layer and external SDRAM

Petr3
Associate III

Hello,

i have custom made board assembled by STM32F767BIT6 and external SDRAM IS42S16400 for video buffers.

The MCU runs at maximum speed 216MHz. LTDC seems to work fine bud when i use dual layer, the second layer seems that reading from external SDRAM is unstable.

I use dual layer and double buffering. So i put each video buffer at start address of one of four SDRAM bank.

I put experimental code for initialisation of video buffers with some colour and put black square 4x4 pixel starting on 46th pixel on first row. Im getting once fifo underrun error flag during initialisation buffer in my code, that is expectable because LTDC wants to get first frame from SDRAM.

First layer is rendered over all TFT area 800x480, i tried to put second layer over bottom half of screen with the same black square starting on position 46th pixel. After that im getting stable four black pixels on position 46-49 as expected, but second, third and fourth row is dynamicaly shifting next four black pixels.

I tried swap first and second layer buffer but the result is the same - first layer OK, second layer not OK.

I have suspicious on wrong SDRAM timing during switching between banks or something like that.

Do you have any idea how to fix this issue?

 

I added attachments with picture of this issue, main.c where is located initialisation of FMC SDRAM, SDRAM_InitSequence function and *.ioc project file with clocks settings.

 

Thanks for any help.

1 REPLY 1
Petr3
Associate III

I added swap for FMC from 0xC000_0000 to 0x6000_0000 and set the MPU. The result doesn't change.

I tried to decrease clock speed of LTDC from 32MHz to 19,2MHz and now it seems to work and i have black square 4x4 pixels in top layer too.

Now i hope that issue doesn't occur when i will write into another two banks(inactive LTDC layer buffers).