2020-05-06 03:21 AM
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.
2020-05-06 04:13 AM
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
2020-05-06 04:27 AM
You shouldn't need to modify setupDataCopy() and fill() in stm32dma.cpp - It will handle the pixel format.
/Martin
2020-05-06 07:55 PM
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.
2020-05-11 03:07 AM
That's great! :) No problem