void SD_EraseTest(void)
{
if (Status == SD_OK)
{
/* 第一个参数为擦除起始地址,第二个参数为擦除结束地址 */
Status = SD_Erase(0x00, (BLOCK_SIZE * NUMBER_OF_BLOCKS));
}
if (Status == SD_OK)
{ /* 读取刚刚擦除的区域 */
Status = SD_ReadMultiBlocks(Buffer_MultiBlock_Rx, 0x00, BLOCK_SIZE, NUMBER_OF_BLOCKS);
/* 查询传输是否结束 */
Status = SD_WaitReadOperation();
while(SD_GetStatus() != SD_TRANSFER_OK);
}
代码单步到红色下一步就进入了HardFault_Handler,求大神解惑呢!!! |