Power: Core2 v1.1 suspend the DCDC under-voltage power-off while disabling the external output - #375
Merged
Merged
Conversation
…bling the external output On the Core2 v1.1 the AXP2101 BLDO2 drives both the boost enable and the /EN of the switch that ties USB VBUS to the 5V bus. While BLDO2 falls the switch closes before the boost stops and the boost output feeds back through VBUS into the PMIC. Without a battery the transient pulls VSYS down and the AXP2101 latches off on DCDC under-voltage (0x21 = 0x20) until the power key is pressed; the USB link goes with it. setExtOutput(false) now clears the DCDC1/DCDC3 under-voltage power-off bits (0x23) for the transition and restores them 20 ms later (the transition completes within 10 ms). Without a battery the ESP32 then brownout-resets with the PMIC and the USB link alive; begin() re-arms the bits since that reset skips the restore. The suspend is skipped when BLDO2 is already off. The call fails closed: when the protection register cannot be read or the suspend write fails the output is left untouched and false is returned; a failed re-arm is reported as false as well. Verified on a Core2 v1.1 with a battery (no change, register restored) and without one (brownout reset instead of a latched power-off).
Merged
lovyan03
added a commit
that referenced
this pull request
Sep 21, 2026
Power: Core2 v1.1 suspend the DCDC under-voltage power-off while disabling the external output (cherry picked from commit 784e58a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On the Core2 v1.1 (AXP2101), calling
M5.Power.setExtOutput(false)while the board is powered from USB without a battery switches the whole board off: the PMIC latches into its power-off state and stays there until the power key is pressed, and the USB link disappears with it. This PR turns that into an ESP32 brownout reset with the PMIC and the USB link alive. With a battery the call is unaffected.Cause
The AXP2101 BLDO2 output is the board's
AXP_BoostENline and drives two enables at once: the EN of the SY7088 boost that makes the 5 V bus, and the /EN of the ME1502 switch that ties USB VBUS to the bus when the boost is off. While BLDO2 falls, the switch closes before the boost stops (measured by sweeping BLDO2: switch on at about 0.9 V, boost off at about 0.5 V), so for a moment the boost output feeds back through VBUS into the PMIC input. With a battery VSYS rides through it. Without one the transient pulls VSYS down and the AXP2101 powers off on DCDC under-voltage (power-off source register 0x21 = 0x20), which is a latched state.There is no BLDO2 voltage at which both the boost and the switch are off, so the transition cannot be sequenced; it can only be made survivable.
Change
setExtOutput(false)on the Core2 / Tough AXP2101 path:falseis returned; a failed re-arm after the transition is reported asfalsetoo (the output is off in that case; the warning says so).Power_Class::begin()sets the DCDC1 / DCDC3 bits of 0x23 on the AXP2101 (their chip default) so that a brownout reset during the call, which skips the restore, does not leave the protection off.The
setExtOutputdoc notes the behaviour: on such a unit without a battery the board resets and reboots with the output enabled again, so a sketch that unconditionally disables the output at startup will loop; with a battery or with 5 V supplied on the bus the transition does not disturb the board; disabling an enabled output blocks for about 20 ms on this model.Verification
setExtOutput(false)unchanged in effect, 0x23 restored to its previous value, repeated calls and re-enable fine.E BOD: Brownout detector was triggeredfollowed by a reset instead of a latched power-off; the USB link stays up and the board comes back with 0x23 re-armed.