cpu/stm32/flashpage: reset PER after erase

This commit is contained in:
Francisco Molina 2021-02-02 11:42:09 +01:00
parent 837b55fc17
commit 3d68406c5b
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -164,10 +164,11 @@ static void _erase_page(void *page_addr)
}
#endif
#ifdef FLASH_CR_PNB
/* reset PER bit (if the register settings exist) */
DEBUG("[flashpage] erase: resetting the page erase bit\n");
CNTRL_REG &= ~(FLASH_CR_PER | FLASH_CR_PNB);
CNTRL_REG &= ~(FLASH_CR_PER);
#ifdef FLASH_CR_PNB
/* reset PNB bit (if the register settings exist) */
CNTRL_REG &= ~(FLASH_CR_PNB);
#endif
/* lock the flash module again */