18#define BORRSTF RCC_RSR_BORRSTF
19#define PINRSTF RCC_RSR_PINRSTF
20#define PORRSTF RCC_RSR_PORRSTF
21#define SFTRSTF RCC_RSR_SFTRSTF
22#define IWDGRSTF RCC_RSR_IWDG1RSTF
23#define WWDGRSTF RCC_RSR_WWDG1RSTF
24#define LPWRRSTF RCC_RSR_LPWRRSTF
27#define BORRSTF RCC_CSR_BORRSTF
28#define PINRSTF RCC_CSR_PINRSTF
29#define PORRSTF RCC_CSR_PORRSTF
30#define SFTRSTF RCC_CSR_SFTRSTF
31#define IWDGRSTF RCC_CSR_IWDGRSTF
32#define WWDGRSTF RCC_CSR_WWDGRSTF
33#define LPWRRSTF RCC_CSR_LPWRRSTF
38 uint32_t cause = RCC->RSR;
42 RCC->RSR |= RCC_RSR_RMVF;
45 uint32_t cause = RCC->CSR;
49 RCC->CSR |= RCC_CSR_RMVF;
53 if (cause & BORRSTF) {
55 }
else if (cause & PORRSTF) {
57 }
else if (cause & SFTRSTF) {
59 }
else if (cause & IWDGRSTF) {
61 }
else if (cause & WWDGRSTF) {
63 }
else if (cause & LPWRRSTF) {
65 }
else if (cause & PINRSTF) {
84 return "Independent hardware watchdog";
86 return "Window watchdog";
88 return "NVIC_SystemReset or by debugger";
90 return "Reset from NRST pin";
92 return "Power on/power-down reset";
94 return "Reset after illegal Stop, Standby or Shutdown mode entry";
98 return "Firewall reset";
100 return "Option byte load reset";
@ Reset_Cause_Illegal_Mode
@ Reset_Cause_Option_Byte
Reset_Cause_t getMCUResetCause()
static Reset_Cause_t readMCUResetCause()
static const volatile Reset_Cause_t resetCause