cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO std library Problem with Writing & reading data

amol
Associate II
Posted on September 02, 2013 at 07:04

Hi,

While every thing is ok response is proper but when i use write data polling or DMA mode my sysem is there in polling or DMA routine, but i am getting response of my command 24 perfect dut transmitting data gives problem i cant understand the problem could anybody suggest me, in 4bit mode....................

These are my routines...

  if (DeviceMode == SD_POLLING_MODE)

  {

    while (!(SDIO->STA & (SDIO_FLAG_DBCKEND | SDIO_FLAG_TXUNDERR |          SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_STBITERR)))

    {

         if (SDIO_GetFlagStatus(SDIO_FLAG_TXFIFOHE) != RESET)

        {

        if ((TotalNumberOfBytes - bytestransferred) < 32)

        {

          restwords = ((TotalNumberOfBytes - bytestransferred) % 4 == 0) ? ((TotalNumberOfBytes - bytestransferred) / 4) : (( TotalNumberOfBytes -  bytestransferred) / 4 + 1);

          for (count = 0; count < restwords; count++, tempbuff++, bytestransferred += 4)

          {

            SDIO_WriteData(*tempbuff);

          }

        }

        else

        {

          for (count = 0; count < 8; count++)

          {

            SDIO_WriteData(*(tempbuff + count));

          }

          tempbuff += 8;

          bytestransferred += 32;

        }

      }

    }

#stm32-sdio-card #sdio-write-data-problem
1 REPLY 1
amol
Associate II
Posted on September 03, 2013 at 13:41