Hello everyone,
I'm currently working on the same problem. I want to use the LTDC driver of the uGFX library with RAM framebuffer location on my STM32F7 Discovery board.
I followed all the steps mentioned by @inmarket:
First of all, I've created a global array RGB565_480x272 of type uint32_t and a size of 65280. This array defines my framebuffer in the MCU's memory.
In the driverCfg struct in file board_STM32LTDC.h, I've changed the frame buffer starting address from SDRAM_DEVICE_ADDR to my array RGB565_480x272 and I've turned off the second layer as you can see in the following code snippet.
...
// board_STM32LTDC.h
#define ALLOW_2ND_LAYER FALSE // TRUE
static uint32_t RGB565_480x272[65280]; // 480x272 Pixel * 2Byte/Pixel / 4Byte/uint32 = 65280 uint32
static const ltdcConfig driverCfg = {
480, 272, // Width, Height (pixels)
41, 10, // Horizontal, Vertical sync (pixels)
13, 2, // Horizontal, Vertical back porch (pixels)
32, 2, // Horizontal, Vertical front porch (pixels)
0, // Sync flags
0x000000, // Clear color (RGB888)
{ // Background layer config
(LLDCOLOR_TYPE *)&RGB565_480x272[0], // Frame buffer address (LLDCOLOR_TYPE *)SDRAM_DEVICE_ADDR,
480, 272, // Width, Height (pixels)
480 * LTDC_PIXELBYTES, // Line pitch (bytes)
LTDC_PIXELFORMAT, // Pixel format
...
Then, in the gdisp_lld_config.h file, I've set the GDISP_LLD_PIXELFORMAT to GDISP_PIXELFORMAT_RGB565
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
and in the init_board() function, I finally removed the BSP_SDRAM_Init() call at the end of the function.
I think these should be all the required changes to use the internal RAM of the MCU as framebuffer for LTDC. Unfortunately, my display doesn't show anything. Maybe some of you have an idea of what I'm doing wrong ...
I'm using the STM32F7 bare metal demo project provided by uGFX. In my gfx_conf.h file, I've defined my GFX OS heap size as follows:
#define GFX_OS_HEAP_SIZE (40960)
Thank you in advance.