1
0
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:
Pavol Rusnak 2021-03-10 18:31:51 +01:00
parent 1e2bb337a9
commit 3294a49cec
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 6 additions and 6 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -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__