Skip to content

Improve brownout recovery#2871

Open
yg-ht wants to merge 12 commits into
meshcore-dev:mainfrom
yg-ht:improve-brownout-recovery
Open

Improve brownout recovery#2871
yg-ht wants to merge 12 commits into
meshcore-dev:mainfrom
yg-ht:improve-brownout-recovery

Conversation

@yg-ht

@yg-ht yg-ht commented Jul 1, 2026

Copy link
Copy Markdown

I actually submitted most of this code a short while ago thinking it wasn't directly useful to me. But as it happens, I needed it after all. This PR is the rest of the bug fix that I was looking for.

Essentially, I kept finding myself needing to do a physical reset of repeaters based on the XIAO nRF52 MCU. I had been a bit "lazy" when it came to wiring up my hardware, especially because I was using an external solar charge / battery controller, I had simply wired up the VUSB and GND pins and ignored the battery sense pins.

It turns out that in this configuration, if the battery gets very low, the device browns out and then can't recover. That is because of a couple of issues:

  • in many situations booting requires the battery sense checking routines to unlock the rest of the boot sequence. If you haven't got the battery sense pins wired up, surprise surprise, it doesn't boot. That logic is now more refined and it copes better with the extra layer of complexity.
  • The device also has no way of knowing what voltage the battery is at when it is being delivered over VUSB. This makes sense, however, what this means is the MCU basically carries on until the +ve rail's voltage collapses. This then puts the MCU in a state that means it isn't willing to contemplate a soft reboot.

Along the way I have added a load of instrumentation so that it is possible to diagnose issues by using real data.

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.

1 participant