cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO DMA Timeout

mailmail9116
Associate II
Posted on June 24, 2013 at 15:13

Hi All ,

Till now i worked with the STM3240G-EVAL , At the beginning i had a problem that i received DMA timeout when i tried to write to the sd-card. The was due to a problem that the DMA interrupt , i.e the 3 next lines :

SDIO_ITConfig(SDIO_IT_DCRCFAIL | SDIO_IT_DTIMEOUT | SDIO_IT_DATAEND | SDIO_IT_RXOVERR | SDIO_IT_STBITERR, ENABLE);
SDIO_DMACmd(ENABLE);
SD_LowLevel_DMA_TxConfig((uint32_t *)writebuff, (NumberOfBlocks * BlockSize));

which enable the DMA were after the DMA request was sent , causing me to go into DMA timeout , i fixed this issue by moving this 3 lines before the DMA request is sent and everything was fine. Now i started working with STM3220G-EVAL which is basically the same evaluation board with the same peripherals and drivers ,the main difference is that is Cortex M3 instead of Cortex M4 , i fixed this issue the same i did on the first evaluation board, But for some reason it does not solve the issue , and i am receiving DMA timeout , i.e i never get to here :

void SD_ProcessDMAIRQ(void)
{
if(DMA2->LISR & SD_SDIO_DMA_FLAG_TCIF)
{
DMAEndOfTransfer = 0x01; //<---Here

DMA_ClearFlag(SD_SDIO_DMA_STREAM, SD_SDIO_DMA_FLAG_TCIF|SD_SDIO_DMA_FLAG_FEIF);
}
}

I don't have any clue why does it happen , maybe some one here can help me with the issue ? Thanks Michael
10 REPLIES 10
mailmail9116
Associate II
Posted on June 30, 2013 at 08:04

A little update , so i fixed the issue :

My whole program is running on the external RAM , what i found out that the FSMC r/w timing parameters  are a little bit different between the evaluation boards , and that what cause the problem when i tried writing to the SDIO , so i corrected the FSMC settings and everything works like magic .

Michael