2019-02-01 05:20 PM
I have a project running an STM32F429, and I have a TFT LCD connected using the FMC subsystem. (I'm not using the LTDC because I'm using that for another LCD). This LCD is an 8080-type interface with 16-bit wide data, /RD, /WR, /CS and command/data select. It's working perfectly if I write to the FMC memory space directly.
I'd like to use DMA2D for faster writes and for format translation. I want to store an 8-bit buffer in RAM and have it translated to 16-bit by the CLUT. This almost works, except that it seems like every other pixel is skipped. If I try to clear the screen using a register to memory transfer only the upper half of the screen is cleared. If I try to write text on the screen, I get something like this
[display line 1, half size][display line 2, half size]
[display line 3, half size][display line 4, half size]
etc...
Each line is scaled by half and because of that, I get two lines of data packed into one line of screen.
I'm wondering if I'm doing something wrong, or if I'm just using DMA2D for something it's not intended for.
My DMA2D config (generated by STM32CubeMX)
hdma2d.Init.Mode = DMA2D_M2M_PFC;
hdma2d.Init.ColorMode = DMA2D_OUTPUT_RGB565;
hdma2d.Init.OutputOffset = 0;
hdma2d.LayerCfg[1].InputOffset = 0;
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_L8;
hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
hdma2d.LayerCfg[1].InputAlpha = 0;
FMC is configured to use A23 for command/data select, figuring that using a low address bit would be a problem. I've triple checked that the dimensions I give the DMA2D transfer routine (480x272) are correct.
Am I missing anything? Thanks in advance for any suggestions!
2019-02-05 10:28 AM
Hi. Perhaps the following thread will help: