mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-26 08:08:51 +00:00
fix(core): don't assert reset flags to allow "reboot to bootloader"
This commit is contained in:
parent
1e2bb337a9
commit
3294a49cec
@ -166,9 +166,7 @@ static secbool copy_sdcard(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
if (sectrue != reset_flags_check()) {
|
reset_flags_reset();
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// need the systick timer running before many HAL operations.
|
// need the systick timer running before many HAL operations.
|
||||||
// want the PVD enabled before flash operations too.
|
// want the PVD enabled before flash operations too.
|
||||||
|
@ -176,8 +176,9 @@ secbool reset_flags_check(void) {
|
|||||||
return secfalse;
|
return secfalse;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RCC->CSR |= RCC_CSR_RMVF; // clear the reset flags
|
|
||||||
|
|
||||||
return sectrue;
|
return sectrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset_flags_reset(void) {
|
||||||
|
RCC->CSR |= RCC_CSR_RMVF; // clear the reset flags
|
||||||
|
}
|
||||||
|
@ -30,5 +30,6 @@ uint32_t flash_set_option_bytes(void);
|
|||||||
secbool flash_configure_option_bytes(void);
|
secbool flash_configure_option_bytes(void);
|
||||||
void periph_init(void);
|
void periph_init(void);
|
||||||
secbool reset_flags_check(void);
|
secbool reset_flags_check(void);
|
||||||
|
void reset_flags_reset(void);
|
||||||
|
|
||||||
#endif // __TREZORHAL_LOWLEVEL_H__
|
#endif // __TREZORHAL_LOWLEVEL_H__
|
||||||
|
Loading…
Reference in New Issue
Block a user