mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 23:38:09 +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) {
|
||||
if (sectrue != reset_flags_check()) {
|
||||
return 1;
|
||||
}
|
||||
reset_flags_reset();
|
||||
|
||||
// need the systick timer running before many HAL operations.
|
||||
// want the PVD enabled before flash operations too.
|
||||
|
@ -176,8 +176,9 @@ secbool reset_flags_check(void) {
|
||||
return secfalse;
|
||||
}
|
||||
#endif
|
||||
|
||||
RCC->CSR |= RCC_CSR_RMVF; // clear the reset flags
|
||||
|
||||
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);
|
||||
void periph_init(void);
|
||||
secbool reset_flags_check(void);
|
||||
void reset_flags_reset(void);
|
||||
|
||||
#endif // __TREZORHAL_LOWLEVEL_H__
|
||||
|
Loading…
Reference in New Issue
Block a user