在SD_read函数中BSP_SD_ReadBlocks_DMA之前对地址进行32字节对齐判断
代码如下:
#if defined(ENABLE_SCRATCH_BUFFER)
if (!((uint32_t)buff & 0x03))
{
#endif
alignedAddr = (uint32_t)buff & ~(__SCB_DCACHE_LINE_SIZE - 1);
if(((uint32_t)buff - alignedAddr) > 0) {
SCB_CleanDCache_by_Addr((uint32_t*)alignedAddr, count*BLOCK_SIZE + ((uint32_t)buff - alignedAddr));
}
/* Fast path cause destination buffer is correctly aligned */
ret = BSP_SD_ReadBlocks_DMA((uint32_t*)buff, (uint32_t)(sector), count);
if (ret == SD_OK) {
#if (osCMSIS < 0x20000U)