FLASH: Make sure that the flash unlock register state is cleared before trying to unlock the flash.
This commit is contained in:
@@ -52,6 +52,9 @@ void flash_set_ws(u32 ws)
|
||||
|
||||
void flash_unlock(void)
|
||||
{
|
||||
/* Clear the unlock state. */
|
||||
FLASH_CR |= FLASH_CR_LOCK;
|
||||
|
||||
/* Authorize the FPEC access. */
|
||||
FLASH_KEYR = FLASH_KEYR_KEY1;
|
||||
FLASH_KEYR = FLASH_KEYR_KEY2;
|
||||
|
||||
Reference in New Issue
Block a user