AnsweredAssumed Answered

Can I use FLOW_STOP with 2D DMA

Question asked by MartyC on May 8, 2012
Latest reply on May 9, 2012 by CraigG

I am using the BF527.

 

I need to receive a buffer that is 256 * 2048 from the SPI port.  I would like to get an interrupt every 2048 bytes that is received.

Currently I receive the first 2048 bytes, and then in the ISR I clear the DMA_DONE bit in the status register. 

Then I get the second 2048 bytes and I do not get any more data after that. 

 

Why does the DMA stop after the second transfer?

 

static const u32 kNUM_BLOCKS = 256;

u8    m_DMA_Buffer[kNUM_BLOCKS * SPI_BUFFER_SIZE];

 

VDK::PushCriticalRegion();  

    *pDMA7_CONFIG           &= ~DMAEN;

    *pDMA7_START_ADDR  = &m_DMA_Buffer[0];

    *pDMA7_X_COUNT          = SPI_BUFFER_SIZE;

    *pDMA7_X_MODIFY         = 1;

    *pDMA7_Y_COUNT          = kNUM_BLOCKS;

    *pDMA7_Y_MODIFY         = 1;

    *pDMA7_PERIPHERAL_MAP   = PMAP_SPI;

    *pDMA7_CONFIG           = DMA2D | WNR | FLOW_STOP | DI_EN | DI_SEL | WDSIZE_8;

VDK::PopCriticalRegion();  

 

  *pSPI_STAT = ( SPIF |  MODF );
  *pSPI_CTL     = (MSTR | RDBR_DMA);
  *pSIC_IMASK0 = IRQ_DMA7;   // DMA Channel 7 (SPI) Interrupt
  *pDMA7_CONFIG |= DMAEN; // Turn on the SPI DMA Controller
  *pSPI_CTL     |= SPE;   // Enable the SPI interface

 

EX_INTERRUPT_HANDLER(DAQ_ISR_IVG13)

  u64 irqStatus = 0;

 

   if (*pSIC_ISR0 & IRQ_DMA7)

   {

     if (*pDMA7_IRQ_STATUS & DMA_DONE) {

       *pDMA7_IRQ_STATUS = DMA_DONE;

       irqStatus |= VOCT::DAQ_Base::INTERRUPT_SPI_DMA7_DONE;

     }

    

     if (*pDMA7_IRQ_STATUS & DMA_ERR)  {

       *pDMA7_IRQ_STATUS = DMA_ERR;

       irqStatus |= VOCT::DAQ_Base::INTERRUPT_SPI_DMA7_ERR;

     }

   }

  ...

}

Outcomes