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)