Hello, there is an inexplicable issues about SDHC of k70 to confuse me. I am developing SD card driver. I found when the sdhc is set multiple block transfer mode and use internal SDMA to transfer data, the data can’t be written into the sd card completely. For example, in my test case, I want to write 4k bytes data to SD card, the driver will use 3 times DMA transfer to finish the work. The first time DMA transfer 1
data block, the second time DMA transfer 4 data blocks, and the third time DMA transfer 3 data blocks. But after the operation finished, I saw there is no expected data in SD card by the second and third time DMA. In general, I often see the last one or two block data of 2nd and 3rd DMA is not in SD card, the expected data of the these blocks is replaced by 0. When I do this test once again, maybe other block is replaced by 0 and the block filled by 0 in previous test is written into the expected data value.
I check the SDHC_IRQSTAT register after every DMA transfer finishes and no any error occurs. I also check the SDHC_DSADDR and SDHC_BLKATTR, the DMA address is updated correctly and the block number and size value is set correctly too. And the DMA buffer address is 0x20000830, this address is in 0x2000_0000–0x200F_FFFF and the cache mode is non-cacheable. So all these set looks OK and I don’t know why the data can’t be written into SD card. How can I debug or go forward?
Any advice is appreciated. Thanks in advance.