块擦除的代码
__ramfunc void erase_block(uint8_t *BlockAddress)
{
/* Enable erase block mode */
FLASH_CR2_ERASE = 1;
FLASH_NCR2_NERASE = 0;
*BlockAddress = (uint8_t)0;
*(BlockAddress + 1) = (uint8_t)0;
*(BlockAddress + 2) = (uint8_t)0;
*(BlockAddress + 3) = (uint8_t)0;
}
|
|