kopia lustrzana https://github.com/solokeys/solo1
patches to improve resistance to fault injection
rodzic
9b8c023505
commit
a9c02cd354
|
@ -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
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue