cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure LCD frame buffer to output RGB565 on STM32H745i-Discovery board

LSW1
Associate

I had modified the project generated by TouchGFX Designer with STM32H750-DK template to run on STM32H745i-discovery board. Since my project has no SPI-FLASH and external SDRAM, I put Image into internal flash and use internal sram as framebuffer. By default, It works on RGB888 fine. But I want to reduce sram usage size, so want to let it works on RGB565 mode.

The modification in my project as below

1.) pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;

When I modify these two function setupDataCopy(), setupDataFill() in stm32dma.cpp

and force set DMA2D_RGB565 mode as below, always into DMA2D_XferErrorCallback()

HAL_DMA2D_SetMode(&hdma2d, dma2dTransferMode,

            DMA2D_RGB565,

           blitOp.dstLoopStride - blitOp.nSteps);

Can anyone help to teach how to set is correct?

Many thanks and Best regards

S.W.

4 REPLIES 4
Alexandre RENOUX
Principal

Hello,

If you are based on the Application Template available in Designer, I suggest you to make the changes in CubeMX instead of directly changing the code. You don't need to touch the DMA2D. You have to modify from RGB888 to RGB565 in the Additional Software section and LTDC section in CubeMX.

The 16bpp (RGB565) version for STM32H750-DK will be available very soon. This will be normally the version 3.0.1.

/Alexandre

Martin KJELDSEN
Chief III

You shouldn't need to modify setupDataCopy() and fill() in stm32dma.cpp - It will handle the pixel format.

/Martin

LSW1
Associate

Many thanks for your response.

After I modify the settings of LTDC and TouchGFX with CubeMX, the DMA2D works fine for 16bpp(RGB565).

My internal SRAM usage size will decrease 130,560 Bytes.

Thanks again for your kindly support.

/S.W.

That's great! 🙂 No problem