You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2024/06/10 10:07:00 UTC
(mynewt-core) 01/06: mcu/stm32f3: Fix reset reason
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 209fbe6b46cfe2b744eb0fc53f35cb559cfc2dfe
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed Jun 5 21:53:37 2024 +0200
mcu/stm32f3: Fix reset reason
POR was not correctly reported.
Signed-off-by: Jerzy Kasenberg <je...@apache.org>
---
hw/mcu/stm/stm32f3xx/src/hal_reset_cause.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_reset_cause.c b/hw/mcu/stm/stm32f3xx/src/hal_reset_cause.c
index e3e28013e..be974a186 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_reset_cause.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_reset_cause.c
@@ -31,16 +31,16 @@ hal_reset_cause(void)
}
reg = RCC->CSR;
- if (reg & RCC_CSR_WWDGRSTF || reg & RCC_CSR_IWDGRSTF) {
+ if (reg & RCC_CSR_PORRSTF) {
+ reason = HAL_RESET_POR;
+ } else if (reg & RCC_CSR_WWDGRSTF || reg & RCC_CSR_IWDGRSTF) {
reason = HAL_RESET_WATCHDOG;
} else if (reg & RCC_CSR_SFTRSTF) {
reason = HAL_RESET_SOFT;
} else if (reg & RCC_CSR_PINRSTF) {
reason = HAL_RESET_PIN;
- } else if (reg & RCC_CSR_PORRSTF) {
- reason = HAL_RESET_BROWNOUT;
} else {
- reason = HAL_RESET_POR;
+ reason = HAL_RESET_OTHER;
}
RCC->CSR |= RCC_CSR_RMVF;
return reason;