Skip to main content
chichkinei
Associate III
June 25, 2014
Question

DMA2D configuration error

  • June 25, 2014
  • 2 replies
  • 784 views
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.
    This topic has been closed for replies.

    2 replies

    stm322399
    Senior
    June 26, 2014
    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 III
    June 27, 2014
    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.