Why SDIO of STM32F4 chip lost 0xF in FIFO buffer?
Hi,
Recently I debug STM32F413 with a SD card by SDIO interface, but failed in FATFS mount. At last, I did a simple test. The code wrote 512 bytes--0x00-0xFF(256 bytes), 0x00-0xFF(256 bytes)--to the first two sectors of SD card by HAL_SD_WriteBlocks, and then read out them by HAL_SD_ReadBlocks. The writing in was successful, because all the bytes in SD card can be seen by Winhex. But when the reading is finished, the lost of 0xF was observed. For example, it is 0x00-0x0F, 0x10 for the first 17 bytes in 512 bytes, the receiving buffer showed 0x00-0x0E, 0x01, 0x02. In this way, 4 bit of 0xF was lost and the buffer cannot receive enough bytes. In the beginning, I think it is the fault of HAL_SD_ReadBlocks fuction, but when DMA was used, the same problem repeated. So I suspect it resulted from SDIO->FIFO buffer of SDIO interface of the chip.
I am not very sure if you see this problem? And is it an absent of some settings of SDIO interface, or a hardware problem of SDIO->FIFO? Could you give your professional suggestions to solve this problem?
Your quick answer is very appreciated. Thank you very much.
Best Regards,
Miller
