usbdfu: Write protect the bootloader sector on F4

This commit is contained in:
Uwe Bonnes 2013-01-22 19:04:51 +01:00
parent 09e2d00b8e
commit 73d120577b
1 changed files with 4 additions and 1 deletions

View File

@ -408,7 +408,10 @@ int main(void)
}
#if defined (STM32F4)
/* don' touch option bits for now */
if ((FLASH_OPTCR & 0x10000) != 0) {
flash_program_option_bytes(FLASH_OPTCR & ~0x10000);
flash_lock_option_bytes();
}
#else
if ((FLASH_WRPR & 0x03) != 0x00) {
flash_unlock();