AnsweredAssumed Answered

SDIO std library Problem with Writing & reading data

Question asked by Amol on Sep 2, 2013
Latest reply on Sep 3, 2013 by Amol
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;
        }
      }
    }

Outcomes