1 Reply Latest reply on Oct 3, 2017 9:56 PM by rameshm_61

    STM32F765 + SN8000 + DMA FIFO Error

      Using WICED Studio 5.0. We have Ported driver based on STM32F4, We are facing problem of DMA fifo Error while firmware download.We are not getting Fifo underrrun error in SDMMC2_STA register.We examined the Fifo burst length which seems to be fine.Please help.

       

      Here is code snippet,

      /* DMA prepare transfer */

      SDIO->DTIMER = (uint32_t) 0xFFFFFFFF;

          SDIO->DLEN   = dma_transfer_size;

          SDIO->DCTRL  = (uint32_t)sdio_get_blocksize_dctrl(block_size) | bus_direction_mapping[(int)direction] | SDIO_TransferMode_Block | SDIO_DPSM_Enable | (1 << 3) | (1 << 11);

       

          /* DMA2 Stream0 */

          DMA2_Stream0->CR   = 0;

          DMA2->LIFCR        = (uint32_t) ( 0x3F );//( 0x3F << 22 );

          DMA2_Stream0->FCR  = (uint32_t) ( 0x00000021 | DMA_FIFOMode_Enable | DMA_FIFOThreshold_Full /*| (1<<7) fifo err */ );

          DMA2_Stream0->PAR  = (uint32_t) &SDIO->FIFO;

          DMA2_Stream0->M0AR = (uint32_t) dma_data_source;

          DMA2_Stream0->NDTR = dma_transfer_size/4;

       

      /* Start DMA stream */

      DMA2_Stream0->CR = (uint32_t)(DMA_DIR_MemoryToPeripheral |

                                             DMA_Channel_11 | DMA_PeripheralInc_Disable | DMA_MemoryInc_Enable |

                                             DMA_PeripheralDataSize_Word | DMA_MemoryDataSize_Word |

                                             DMA_Mode_Normal | DMA_Priority_VeryHigh |

                                             DMA_MemoryBurst_INC4 | DMA_PeripheralBurst_INC4 | DMA_SxCR_PFCTRL | DMA_SxCR_TCIE | DMA_SxCR_EN );

       

      On execution of above step in SDIO IRQ,We are getting DMA FIFO error event bit set in DMA2_LISR register and transfer gets timedout.