*** Booting Zephyr OS build *** keeps appearing: the board is rebooting
Zephyr prints this banner once, early in every boot. Seeing it a second time in one session means the SoC went through a reset, and the banner itself does not say why.
The line
[00:01:12.480,000] <inf> app: sample 1423 sent
*** Booting Zephyr OS build v4.2.0 ***
[00:00:00.004,000] <inf> app: startingIllustrative application lines around a real banner format. The log timestamp falling back to zero is the second sign of a restart.
What it means
The banner is printed by the kernel during start-up when CONFIG_BOOT_BANNER is on, which is the default. The text after build is the version string the firmware was built from, so it also tells you whether the image that is running is the one you just flashed. With CONFIG_BOOT_DELAY set, the line ends in (delayed boot Nms).
A reset you did not ask for has a short list of possible origins: the firmware reset itself, a watchdog did, the supply dropped, or something outside pulled the reset line. Zephyr’s default fatal error handler is not on that list, because it halts the system instead of rebooting.
Reset cause flags returned by hwinfo_get_reset_cause()
Applies to: Zephyr v4.2.0 include/zephyr/drivers/hwinfo.h; which flags a SoC can report depends on its driver.
| Flag | Bit | Points at |
|---|---|---|
| RESET_PIN | 0 | The reset pin: a button, a debug probe, or an adapter line wired to reset. |
| RESET_SOFTWARE | 1 | The firmware asked for it: sys_reboot(), a bootloader swap, a handler that reboots. |
| RESET_BROWNOUT | 2 | The supply fell below the brownout threshold. |
| RESET_POR | 3 | Power was removed and applied again. |
| RESET_WATCHDOG | 4 | A watchdog timer expired. |
| RESET_DEBUG | 5 | The debug interface requested the reset. |
| RESET_LOW_POWER_WAKE | 7 | A wake-up from a low power mode that restarts the SoC. |
| RESET_CPU_LOCKUP | 8 | The CPU locked up, for example a fault inside the hard fault handler. |
Common causes
A fatal error handler that reboots
Zephyr’s own k_sys_fatal_error_handler() logs Halting system and stops. Applications and vendor SDKs often replace it with one that reboots, so that a product recovers in the field. In that case the lines just before the banner are a >>> ZEPHYR FATAL ERROR report, if the log was flushed before the reset.
A watchdog that was not fed
Once a hardware watchdog is set up, the application has to feed it with wdt_feed() before each timeout; the task watchdog subsystem does the same per thread on top of it. A thread that blocks, or a loop that runs long, misses the window, and the reset arrives without a fatal error report because no kernel code was involved.
Sources: Zephyr docs: Watchdog · Zephyr docs: Task Watchdog
Power: a brownout or a power cycle
A supply that dips when a radio or a motor starts resets the SoC in the middle of whatever it was doing, so the log before the banner often stops halfway through a line. Where the SoC driver supports it, the reset cause reads RESET_BROWNOUT or RESET_POR afterwards.
Source: Zephyr docs: Hardware Information (hwinfo_get_reset_cause)
The reset pin or the debug probe
Flashing and attaching a debugger reset the target, and on some boards opening the serial port does too, because an adapter control line is wired to reset. These show up as RESET_PIN or RESET_DEBUG. They are harmless, but worth ruling out before you search the firmware for a bug.
Sources: Zephyr docs: Hardware Information (hwinfo_get_reset_cause) · Zephyr docs: Building, Flashing and Debugging with west
What to check first
- Look at the lines right before the banner. A fatal error report means the firmware rebooted itself after a crash; a line cut off in the middle means the reset came from a watchdog, the supply or the reset pin.
- If the build enables a watchdog, compare the interval between banners with the window passed to
wdt_install_timeout()or the task watchdog’s reload period. An interval that matches it is the watchdog; one that does not rules it out. - Ask the SoC. Call
hwinfo_get_reset_cause()at the start ofmain(), print the value and then callhwinfo_clear_reset_cause(), because the flags accumulate until they are cleared. With the shell enabled,hwinfo reset_cause showprints the same flags by name. - Compare the version string in the banner with the build you think is running. An old string after flashing means the image did not change, or a bootloader reverted to the previous one.
- To keep the evidence of a crash, make the firmware halt on fatal errors while you debug, or enable the core dump subsystem so that the fault survives the reboot.
- If the reset happens only with the serial cable attached or only when the port is opened, check whether the adapter’s DTR or RTS line is connected to the board’s reset.
In NeuroTerm
On a serial tab with pattern markers on, NeuroTerm recognises this line as “Board reset: Zephyr boot”. 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).