stm32:l4:flash: Fix option bytes programming
FLASH_CR_OPTSTRT needs to be written to FLASH_CR, and there is no reason to mask the last two data bits. Signed-off-by: Bruno Randolf <br1@einfach.org> Reviewed-by: Karl Palsson <karlp@tweak.net.au> (original code appeared to be badly copied from the flash_common_f24 codebase)
This commit is contained in:
parent
833ddd9b0a
commit
53ce5aa3dd
@ -196,8 +196,8 @@ void flash_program_option_bytes(uint32_t data)
|
||||
flash_unlock_option_bytes();
|
||||
}
|
||||
|
||||
FLASH_OPTR = data & ~0x3;
|
||||
FLASH_OPTR |= FLASH_CR_OPTSTRT;
|
||||
FLASH_OPTR = data;
|
||||
FLASH_CR |= FLASH_CR_OPTSTRT;
|
||||
flash_wait_for_last_operation();
|
||||
}
|
||||
/**@}*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user