STM32F746 DMA2D RGB to ARGB pixel format conversion not working
I am prototyping on the STM32F746G-DISCO board but I have a problem with the DMA2D.
I have used this micro on previous projects and even the DMA2D without issue, but this is the first time I have tried RGB888 to ARGB8888 pixel conversion.
If I use ARGB to ARGB, both in Memory to Memory (M2M) mode and M2M with conversion (PFC), it works fine. But if I set the foreground format to RGB888, the conversion produces bad data.
So for a 69x69 pixel RGB888 input image located in QSPI running in memory mapped mode, writing to an SDRAM buffer, I have the following (example) code:
while ( DMA2D->CR & DMA2D_CR_START )
{
// wait for DMA2D complete
}
// setup the registers
DMA2D->CR = 1UL << 16; // M2M with PFC
// address of the input (QSPI)
DMA2D->FGMAR = 0x90000000;
// Override the alpha (although unnecessary) and set the format to RGB888
DMA2D->FGPFCCR = 0xFF010001;
DMA2D->FGOR = 0; // no need to skip any pixels in the source
// output address - SDRAM buffer
DMA2D->OMAR = 0xC0000000;
DMA2D->OPFCCR = 0; // Output as ARGB8888
DMA2D->OOR = (LCD_WIDTH_IN_PIXELS) - 69; // image is 69x69 pixels
DMA2D->NLR = (69) | (69 << 16);
// start the process
DMA2D->CR = DMA2D_CR_START;The output should be a square, but it ends up looking like 4 rectangles with missing lines.
Strangely, if I scale the values passed to the NLR and OOR by (4/3), the output looks correct.
Has anyone seen this? I am missing some configuration?
Thanks,
Chris