1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

fix(core): correct swapped F4/U5 reset flags

[no changelog]
This commit is contained in:
cepetr 2024-10-22 22:07:45 +02:00 committed by cepetr
parent a1ab50017d
commit 3a19609035
2 changed files with 5 additions and 5 deletions

View File

@ -29,8 +29,9 @@ secbool reset_flags_check(void) {
// for production. check the reset flags to assure that we arrive here due to // for production. check the reset flags to assure that we arrive here due to
// a regular full power-on event, and not as a result of a lesser reset. // a regular full power-on event, and not as a result of a lesser reset.
if ((RCC->CSR & (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_IWDGRSTF | if ((RCC->CSR & (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_IWDGRSTF |
RCC_CSR_SFTRSTF | RCC_CSR_PINRSTF | RCC_CSR_BORRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF | RCC_CSR_PINRSTF |
RCC_CSR_OBLRSTF)) != (RCC_CSR_PINRSTF | RCC_CSR_BORRSTF)) { RCC_CSR_BORRSTF)) !=
(RCC_CSR_PORRSTF | RCC_CSR_PINRSTF | RCC_CSR_BORRSTF)) {
return secfalse; return secfalse;
} }
#endif #endif

View File

@ -29,9 +29,8 @@ secbool reset_flags_check(void) {
// for production. check the reset flags to assure that we arrive here due to // for production. check the reset flags to assure that we arrive here due to
// a regular full power-on event, and not as a result of a lesser reset. // a regular full power-on event, and not as a result of a lesser reset.
if ((RCC->CSR & (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_IWDGRSTF | if ((RCC->CSR & (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_IWDGRSTF |
RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF | RCC_CSR_PINRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PINRSTF | RCC_CSR_BORRSTF |
RCC_CSR_BORRSTF)) != RCC_CSR_OBLRSTF)) != (RCC_CSR_PINRSTF | RCC_CSR_BORRSTF)) {
(RCC_CSR_PORRSTF | RCC_CSR_PINRSTF | RCC_CSR_BORRSTF)) {
return secfalse; return secfalse;
} }
#endif #endif