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 <[email protected]> AuthorDate: Wed Jun 5 21:53:37 2024 +0200 mcu/stm32f3: Fix reset reason POR was not correctly reported. Signed-off-by: Jerzy Kasenberg <[email protected]> --- 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;
