stm32: flash_unlock_option_bytes is common code.
The keys differ between some familes, but the documentation and implementation are standard.
This commit is contained in:
@@ -85,20 +85,6 @@ void flash_program_word(uint32_t address, uint32_t data)
|
||||
flash_program_half_word(address+2, (uint16_t)(data>>16));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Unlock the Option Byte Access
|
||||
|
||||
This enables write access to the option bytes. It is locked by default on
|
||||
reset.
|
||||
*/
|
||||
|
||||
void flash_unlock_option_bytes(void)
|
||||
{
|
||||
/* F1 uses same keys for flash and option */
|
||||
FLASH_OPTKEYR = FLASH_KEYR_KEY1;
|
||||
FLASH_OPTKEYR = FLASH_KEYR_KEY2;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Erase All Option Bytes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user