hi:
I find two bug SDK_2_12_0_MIMXRT1052xxxxB/middleware/sdmmc/sd/fsl_sd.c,
bug1:
SD_ReadBlocks and SD_WriteBlocks, determine if the cache is aligned,code is
((uint32_t)nextBuffer) & (sizeof(uint32_t) - 1U), it should be
((uint32_t)nextBuffer) & (SDMMC_DATA_BUFFER_ALIGN_CACHE - 1U).
Just because the data used in the example is stored in dtcm, the problem is not exposed. If ocram or sdram is used, there may be problems with the transmission of the sd card.
bug2:
SD_PollingCardStatusBusy(). When the sd card continues to read files, it will be stuck when the card is pulled out.
Because cardBusy is always false, and SD_SendCardStatus() return kStatus_USDHC_SendCommandFailed, so it stuck.
Please check and fix it. Thanks.
Hi @dasg ,
1. But there is no word say the buffer must be 32 byte align in reference manual. Can you give an example?
2. Yes, SD_SendCardStatus() or low level function should prevent kStatus_USDHC_SendCommandFailed return to high level function. I'll report the software team your suggestion.
Regards,
Jing
Hi @jingpan
1. Because the Dcache,so buffer need 32 bytes align. You can try change buffer from DTCM to OCRAM, then, read a long file(example 1MB) from tail to begin, the data read is misplaced;Maybe mount and then open will make an error, no need to read。