2014-06-24 05:28 PM
I'm trying to do a simple memory to memory transfer with the DMA2D, but the configuration error flag is being set when I start a transfer. Here is the initialization code:
uint16_t *imageBuf = (uint16_t*)0xC0000000;
RCC->AHB1ENR |= RCC_AHB1Periph_DMA2D;
DMA2D->FGPFCCR = DMA2D_RGB565;
DMA2D->FGCOLR = 0;
DMA2D->FGMAR = (uint32_t)imageBuf+76800;
DMA2D->FGOR = 0;
DMA2D->CR = DMA2D_M2M;
DMA2D->OPFCCR = DMA2D_RGB565;
DMA2D->OCOLR = 0;
DMA2D->OMAR = (uint32_t)imageBuf;
DMA2D->OOR = 0;
DMA2D->NLR = (uint32_t)((240<16)|320);
The reference manual has a section on configuration errors and what can cause them, and my code seems to check out, but clearly there is still something wrong.
2014-06-25 10:57 PM
Could it be that NLR is wrongly set ? There is a typo in your left shift operator.
2014-06-26 08:40 PM
Thanks, that was it. No idea how I didn't see it the first 20 times I looked over the code. The compiler didn't even give a warning either.