Skip to content

nRF52840 Power Management Stage 1 (Boot Lock) - v2.3 preparation work#3002

Open
entr0p1 wants to merge 1 commit into
meshcore-dev:devfrom
entr0p1:feat/nrf52-pwrmgt-v2_3-prep1
Open

nRF52840 Power Management Stage 1 (Boot Lock) - v2.3 preparation work#3002
entr0p1 wants to merge 1 commit into
meshcore-dev:devfrom
entr0p1:feat/nrf52-pwrmgt-v2_3-prep1

Conversation

@entr0p1

@entr0p1 entr0p1 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This commit lays some of the ground work for the upcoming power management fix that allows users to configure the boot lock behaviour.

It is not the full fix yet. The goal is to break up the larger commit into smaller chunks so it is easier to review and softer to merge.

Regression tests done on a Xiao nRF52840 and no issues experienced with the pre-existing lock and recovery.

Improvements:

  • MainBoard: Add bool to check if power management has been initialised (later to be consumed by CommonCLI to validate we can safely configure the settings)
  • MainBoard: Add bool to validate LPCOMP is supported on the board (gates LPCOMP config so it doesnt wedge on an unsupported board)
  • NRF52Board: Rename initPowerMgr() -> pwrmgtInit() to align with the "pwrmgt" prefix being used by any power management related functions in the upcoming new version
  • NRF52Board: Add a shutdown reason for "None" so the get pwrmgt.bootreason command doesnt erroneously return "Unknown"
  • NRF52Board: Add gate in configureVoltageWake to not arm LPCOMP when power management isn't initialised or the board doesn't support LPCOMP (i.e. we havent defined the AIN pin)
  • NRF52Board: Reference the LPCOMP AIN pin directly instead of from the per-board definitions to align to the upcoming deprecation of the per-board static configs
  • NRF52Board: Drop LPCOMP hysteresis as it broadens the wake voltage too much and makes the board less likely to self-recover
  • NRF52Board: Separate LPCOMP and VBUS wake arm into their own functions

This commit lays some of the ground work for the upcoming power management fix that allows users to configure the boot lock behaviour.

It is *not* the full fix yet. The goal is to break up the larger commit into smaller chunks so it is easier to review and softer to merge.

Improvements:
- MainBoard: Add bool to check if power management has been initialised (later to be consumed by CommonCLI to validate we can safely configure the settings)
- MainBoard: Add bool to validate LPCOMP is supported on the board (gates LPCOMP config so it doesnt wedge on an unsupported board)
- NRF52Board: Rename initPowerMgr() -> pwrmgtInit() to align with the "pwrmgt" prefix being used by any power management related functions in the upcoming new version
- NRF52Board: Add a shutdown reason for "None" so the `get pwrmgt.bootreason` command doesnt erroneously return "Unknown"
- NRF52Board: Add gate in configureVoltageWake to not arm LPCOMP when power management isn't initialised or the board doesn't support LPCOMP (i.e. we havent defined the AIN pin)
- NRF52Board: Reference the LPCOMP AIN pin directly instead of from the per-board definitions to align to the upcoming deprecation of the per-board static configs
- NRF52Board: Drop LPCOMP hysteresis as it broadens the wake voltage too much and makes the board less likely to self-recover
- NRF52Board: Separate LPCOMP and VBUS wake arm into their own functions
@fdlamotte fdlamotte self-assigned this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants