cancel
Showing results for 
Search instead for 
Did you mean: 

DMA2D configuration error

chichkinei
Associate II
Posted on June 25, 2014 at 02:28

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.
2 REPLIES 2
stm322399
Senior
Posted on June 26, 2014 at 07:57

Could it be that NLR is wrongly set ? There is a typo in your left shift operator.

chichkinei
Associate II
Posted on June 27, 2014 at 05:40

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.