// Bootload master must have verified extra checks to be issuing the SB_ENABLE_CMD.
//if ((crc[0] != crc[1]) && (crc[0] != 0xFFFF) && (crc[0] != 0x0000))
if (crc[1] != crc[0])
{
crc[1] = crc[0];
HalFlashWrite((HAL_SB_CRC_ADDR / HAL_FLASH_WORD_SIZE), (uint8 *)crc, 1);
HalFlashRead( HAL_SB_CRC_ADDR / HAL_FLASH_PAGE_SIZE,
HAL_SB_CRC_ADDR % HAL_FLASH_PAGE_SIZE,
(uint8 *)crc, sizeof(crc));
}
这里的HalFlashWrite 好象有Bug,因为写之前没有Erase,但是这个时候又不能Erase,所以写一定失败
Susan Yang:
回复 ua A:
谢谢分享!