AnsweredAssumed Answered

SDIO can't read more than 511 blocks

Question asked by Unparagoned on Jun 26, 2012
Latest reply on Jun 27, 2012 by Clive One
I'm using the standard STM libaries. I'm using SDIO with DMA. It works perfectly when reading up to 511 blocks but as soon as I try and read 512 blocks it stops working. It would successfully transfer 511 blocks then stop and become non-responsive. It seems like I must be missing something obvious due to the number of blocks it stops on. I looked at the varaibles used and registers but 512 blocks of 512 bytes doesn't seem like it would overun any of them.

I guess the relevant code is below. Where if NumberOfBlocks is above 511 it stops working.

 SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;
SDIO_DataInitStructure.SDIO_DataLength = NumberOfBlocks * BlockSize;
SDIO_DataInitStructure.SDIO_DataBlockSize = (uint32_t) 9 << 4;
SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToSDIO;
SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block ;
SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;