2015-06-16 05:26 AM
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 #ltdc2015-06-16 05:44 AM
/* 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.hSTM32F429I-Discovery_FW_V1.0.1\Utilities\STM32F429I-Discovery\stm32f429i_discovery_lcd.c2015-06-16 06:09 AM
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?2015-06-16 07:06 AM
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. JW2015-06-16 07:14 AM
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!2015-06-16 07:46 AM
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.
2015-06-16 12:18 PM
Thanks Clive! For RAM space calculation is this OK approach: 320x240*18bits/8bits = 172,8kB of memory of 256kB total for 1 layer?