Skip to content

Power: set the AXP2101 charge voltage to 4.2V at init (CoreS3 family, Core2 v1.1) - #392

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:axp2101_charge_voltage
Oct 7, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:axp2101_charge_voltage

Conversation

@ainyan03

@ainyan03 ainyan03 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #388 for #387.

The power-on value of the AXP2101 charge-voltage register (REG 0x64) is not always the datasheet default (011b = 4.2V). The CoreS3 SE in #387 read 0x64 = 0x00, which is reserved in the current datasheet and was listed as 4.6V in an early revision. The units here read 0x03. M5Unified did not write this register at init, so such a unit charges with whatever the register holds at power-on.

The cells on the CoreS3 family and Core2 v1.1 are 4.2V types, so the init now sets 4.2V explicitly through setChargeVoltage(4200), before the TS pin setting from #388 that lets the charger start. Chips that already read 0x03 are unaffected. A failed write is logged as a warning.

Note: a second Power.begin() call sets 4.2V again, replacing a lower target set with setChargeVoltage() before it.

Tested on Core2 v1.1: after writing 0x64 = 0x00 and restarting the ESP32 (the AXP2101 keeps its registers), the register reads 0x03 again after M5.begin().

REG 0x67 (charge safety timers, also 0x00 on that unit) is left unchanged here; enabling the timers changes charging behaviour and needs a separate look.

… Core2 v1.1)

The power-on value of REG 0x64 (constant-voltage target) is not always the datasheet
default (011b = 4.2V): a CoreS3 SE was reported with 0x64 = 0x00, which is reserved in the
current datasheet and was listed as 4.6V in an early revision. The cells on these boards
are 4.2V types, so the target is now set explicitly at init, before the TS pin setting
that lets the charger start. Chips that already read 0x03 are unaffected. A failed write
is logged as a warning.

A second Power.begin() call sets 4.2V again (when the write succeeds), replacing a lower
target set with setChargeVoltage() before it.
@lovyan03
lovyan03 merged commit dfa4fb7 into m5stack:develop Oct 7, 2026
30 checks passed
@ainyan03
ainyan03 deleted the axp2101_charge_voltage branch October 7, 2026 03:24
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