Reset Reason, RCC_CSR=0x...: decoding an STM32 reset

At boot the firmware read the STM32 reset status register and printed it. The hexadecimal value holds one flag per reset source, and the next line names the one the code picked.

The line

Reset Reason, RCC_CSR=0x24000000
Reset Causes: 
 Independent Watchdog

Printed by the Memfault firmware SDK’s STM32F4 port; your log prefix depends on the logging backend. 0x24000000 is IWDGRSTF (bit 29) plus PINRSTF (bit 26).

What it means

The line comes from the Memfault firmware SDK’s reboot tracking port for STM32. It reads RCC->CSR, prints the raw value, then walks the flags in a fixed order and prints the first one that is set: standby wake-up, low power, software, independent watchdog, window watchdog, power on, brown out, pin. After that it clears the flags, because they stay set across resets until software clears them.

Read the hexadecimal value yourself as well as the name. More than one flag is usually set, and the fixed order hides some: the pin flag accompanies most other resets, which is why Pin Reset is printed only when nothing else is set, and a power-on is reported even when the brown-out flag is set alongside it.

RCC_CSR reset flags

Applies to: STM32F4 (stm32f407xx.h). Other STM32 families keep the same flag names but move some bits, so check the header or reference manual for your part.

BitMaskFlagMemfault printsReset source
310x80000000LPWRRSTFLow PowerLow-power management reset.
300x40000000WWDGRSTFWindow WatchdogThe window watchdog was refreshed outside its window, or not at all.
290x20000000IWDGRSTFIndependent WatchdogThe independent watchdog was not reloaded in time.
280x10000000SFTRSTFSoftwareThe firmware requested a system reset.
270x08000000PORRSTFPower on ResetPower-on or power-down reset.
260x04000000PINRSTFPin ResetThe NRST pin was low.
250x02000000BORRSTFBrown outThe supply fell below the brown-out level.
240x01000000RMVF(not a cause)Write 1 to clear the reset flags.

Source: STMicroelectronics cmsis_device_f4 v2.6.9: stm32f407xx.h (RCC_CSR bit definitions)

Common causes

Independent Watchdog or Window Watchdog: the firmware stopped feeding it

A watchdog reset means the code that reloads the watchdog did not run in time: a task blocked on something that never came, a loop with interrupts disabled, a fault handler that spins. It is the hardware saying the firmware hung; the hang itself happened before the reset and left nothing in this line.

Sources: Memfault firmware SDK 1.46.0: ports/stm32cube/f4/rcc_reboot_tracking.c, the code that prints the line · Memfault Interrupt: A Guide to Watchdog Timers for Embedded Systems

Software: the firmware asked for the reset

SFTRSTF is set when code requests a system reset, which is what NVIC_SystemReset() does. That covers deliberate restarts after a firmware update or a configuration change, and also fault and assert handlers that end in a reset, so a software reset you did not expect is often a crash that was handled.

Sources: Memfault firmware SDK 1.46.0: ports/stm32cube/f4/rcc_reboot_tracking.c, the code that prints the line · STMicroelectronics cmsis_device_f4 v2.6.9: stm32f407xx.h (RCC_CSR bit definitions)

Power on Reset or Brown out: the supply

PORRSTF and BORRSTF report that the supply was absent or below the brown-out level. After plugging the board in that is normal. Seeing them on a board that was running means the rail collapsed, typically under a load step, and the firmware was not involved.

Sources: Memfault firmware SDK 1.46.0: ports/stm32cube/f4/rcc_reboot_tracking.c, the code that prints the line · STMicroelectronics cmsis_device_f4 v2.6.9: stm32f407xx.h (RCC_CSR bit definitions)

Pin Reset: something pulled NRST

Memfault prints Pin Reset only when PINRSTF is the single cause left, so it points at the reset line itself: the reset button, a debug probe that resets the target when it connects or flashes, or an external supervisor or watchdog chip.

Source: Memfault firmware SDK 1.46.0: ports/stm32cube/f4/rcc_reboot_tracking.c, the code that prints the line

Standby Wakeup or Low Power: the low-power path

The port checks the standby flag of the power controller first and prints Standby Wakeup when the MCU is coming back from Standby mode, which restarts the program by design. Low Power is LPWRRSTF, the low-power management reset: a reset taken on the way into a low-power mode, not on the way out. The port files both under a deep sleep reboot reason, so a Low Power you did not plan for deserves a look at how the firmware enters Stop and Standby.

Source: Memfault firmware SDK 1.46.0: ports/stm32cube/f4/rcc_reboot_tracking.c, the code that prints the line

What to check first

  1. Decode the hexadecimal value with the table and note every flag that is set, not only the name printed under Reset Causes:.
  2. For a watchdog cause, find what ran last before the reset: the final log lines before the boot, and which task is responsible for reloading the watchdog.
  3. For Software, search the firmware for the places that request a reset (NVIC_SystemReset, assert and fault handlers, the update path) and log a reason before each of them.
  4. For Power on Reset or Brown out on a running board, put a scope on the supply at the MCU pin and trigger on the drop; compare with what the firmware switches on at that moment.
  5. If the same value appears on every boot whatever you do, check that the flags are being cleared: they persist until RMVF is written, so a stale flag can describe an older reset.
  6. If you are not on an STM32F4, confirm the bit positions in the device header for your family before trusting the decode.

In NeuroTerm

On a serial tab with pattern markers on, NeuroTerm recognises this line as “Board reset: reset reason”. A coding agent connected through Terminal Use gets that name in its list of tabs and among the markers of the output it reads, with a cursor for reading the lines around it. Setup is in Terminal Use (MCP).