cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 LTDC and SDRAM

predrag10
Associate II
Posted on June 16, 2015 at 14:26

Is it possible to use internal RAM as a frame buffer for LTDC?

Where exactly in std lib examples are external RAM and LTDC connected? It seems to me that the code is written on SDRAM address but I cannot find any DMA/DMA2D initialization for sending data from SDRAM to LTDC controller.

Thank you!

#!stm32f4-disco #!stm32f4-disco #sdram #sdram #ltdc
6 REPLIES 6
Posted on June 16, 2015 at 14:44

/* LCD Size (Width and Height) */

#define  LCD_PIXEL_WIDTH    ((uint16_t)240)

#define  LCD_PIXEL_HEIGHT   ((uint16_t)320)

#define LCD_FRAME_BUFFER       ((uint32_t)0xD0000000)

#define BUFFER_OFFSET          ((uint32_t)0x50000)

STM32F429I-Discovery_FW_V1.0.1\Utilities\STM32F429I-Discovery\stm32f429i_discovery_lcd.h

STM32F429I-Discovery_FW_V1.0.1\Utilities\STM32F429I-Discovery\stm32f429i_discovery_lcd.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
predrag10
Associate II
Posted on June 16, 2015 at 15:09

I've seen that and realize that writing to LCD to draw a char is writing to external RAM memory address i.e.

*(__IO uint16_t*) (CurrentFrameBuffer + (2*Xaddress) + xpos) = CurrentBackColor;

How is then the data converted from SDRAM to LTDC RGB pins?

Can I use internal SRAM memory instead of external SDRAM?

Posted on June 16, 2015 at 16:06

I don't use the LCD controller but if I read RM0090 right, the LCD controller is an AHB-matrix master and incorporates a DMA of its own. The framebuffer address is held in LTDC_LxCFBAR.

According to fig.2, the controller can master the FLASH, all the three SRAMs and the FMC controller.

JW
predrag10
Associate II
Posted on June 16, 2015 at 16:14

Ok I've figured it out. You need to enter start address of LTDC Layer1 and/or Layer2:

LTDC_Layer_InitStruct.LTDC_CFBStartAdress = LCD_FRAME_BUFFER;

If you use external SDRAM you have level of abstraction and by writing on memory location 0xD0000000 or 0xC0000000 you are writing both on SDRAM and LTDC.

Thank you, guys!

Posted on June 16, 2015 at 16:46

Yes, you both have access to the frame buffer, from a user perspective you paint content there, and from the peripheral side is sits in a loop copying/streaming the data out in the prescribed format to the lines of the screen, over-and-over.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
predrag10
Associate II
Posted on June 16, 2015 at 21:18

Thanks Clive! For RAM space calculation is this OK approach: 320x240*18bits/8bits = 172,8kB of memory of 256kB total for 1 layer?