patches to improve resistance to fault injection

pull/505/head
Conor Patrick 2021-01-27 19:47:45 -08:00
rodzic 9b8c023505
commit a9c02cd354
2 zmienionych plików z 11 dodań i 7 usunięć

Wyświetl plik

@ -304,6 +304,12 @@ void device_init()
hw_init(LOW_FREQUENCY);
#if BOOT_TO_DFU
flash_option_bytes_init(1);
#else
flash_option_bytes_init(0);
#endif
if (! tsc_sensor_exists())
{
_NFC_status = nfc_init();
@ -329,12 +335,6 @@ void device_init()
device_migrate();
#if BOOT_TO_DFU
flash_option_bytes_init(1);
#else
flash_option_bytes_init(0);
#endif
}

Wyświetl plik

@ -70,7 +70,11 @@ void flash_option_bytes_init(int boot_from_dfu)
flash_lock();
__enable_irq();
/* Perform option byte loading which triggers a device reset. */
FLASH->CR |= FLASH_CR_OBL_LAUNCH;
while (true);
}
void flash_erase_page(uint8_t page)