From 208333d51159e0b06ba32f4c6ed22b8bd9c33881 Mon Sep 17 00:00:00 2001 From: Robert Ekl Date: Wed, 2 Sep 2026 11:27:56 -0500 Subject: [PATCH] docs: correct pwrmgt CLI behaviour on unsupported boards The doc claimed every pwrmgt command except `get pwrmgt.support` returns "ERROR: Power management not supported" when NRF52_POWER_MANAGEMENT is not defined. `get pwrmgt.bootreason` is not inside the #ifdef (CommonCLI.cpp:787) and answers on all boards; only pwrmgt.source and pwrmgt.bootmv are gated. --- docs/nrf52_power_management.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/nrf52_power_management.md b/docs/nrf52_power_management.md index 6d97f2c30..417ee6dd6 100644 --- a/docs/nrf52_power_management.md +++ b/docs/nrf52_power_management.md @@ -186,11 +186,19 @@ Power management status can be queried via the CLI: | `get pwrmgt.bootreason` | Returns reset and shutdown reason strings | | `get pwrmgt.bootmv` | Returns boot voltage in millivolts | -On boards without power management enabled, all commands except `get pwrmgt.support` return: +On boards without power management enabled, `get pwrmgt.source` and +`get pwrmgt.bootmv` return: ``` ERROR: Power management not supported ``` +`get pwrmgt.support` returns `unsupported`. `get pwrmgt.bootreason` is not +compiled out at all and answers on every board: `getResetReason()` and +`getShutdownReason()` are virtuals on the base board class, so a board that +does not override them reports `Not available` rather than an error. ESP32 +boards override the reset half with `esp_reset_reason()`, so they return a real +reset reason and `Not available` for the shutdown reason. + ## Debug Output When `MESH_DEBUG=1` is enabled, the power management module outputs: