Skip to content

AXP2101: set the TS pin to external input on CoreS3 and Core2 v1.1 so it does not block the charger - #388

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:ts_pin_ext_input
Oct 5, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:ts_pin_ext_input

Conversation

@ainyan03

@ainyan03 ainyan03 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #387.

On CoreS3 / CoreS3 SE / StackChan and Core2 v1.1 the AXP2101 TS pin has no battery thermistor: it senses the 5V bus (CoreS3) or reads about 2.9 V (Core2 v1.1). Whether TS qualifies charging is selected by REG 0x50 bit 4, and its power-on value comes from the EFUSE and differs between chips. On units where it is 0, the charger treats the TS voltage as a cold battery (above VLTF-CHG) and never charges, as reported in #387 and on the forum.

This sets 0x50[4] in the CoreS3-family and Core2 v1.1 initialization so that TS is an external input that does not affect the charger. The TS ADC channel stays enabled, since the CoreS3 code uses it to detect 5V on the bus. The write is a no-op on chips whose default is already 1.

Verification:

  • CoreS3 (0x50 = 0x1A) and Core2 v1.1 (0x50 = 0x1F) here already had bit 4 set from the EFUSE; registers and charging state are unchanged with this patch.
  • The mechanism was reproduced on the Core2 v1.1 by lowering VLTF-CHG to 1.3 V and clearing bit 4: charging stopped immediately (0x01 = 0x5D), and stayed stopped with bit 4 set again until VBUS was re-inserted.
  • Builds on the CI matrix (ESP-IDF 5.1–6.1, Arduino 2.0 / 3.0–3.3) pass with no new warnings.

… it does not block the charger

TS has no battery thermistor on these boards; it senses the 5V bus (CoreS3) or reads
about 2.9V (Core2 v1.1). REG 0x50 bit 4 selects whether TS qualifies charging, and its
power-on default comes from the EFUSE and differs between chips: on units where it is 0,
the charger treats the TS voltage as a cold battery and never charges (m5stack#387).
Setting the bit is a no-op on chips whose default is already 1.
@lovyan03
lovyan03 merged commit 1b6bbd9 into m5stack:develop Oct 5, 2026
30 checks passed
@ainyan03
ainyan03 deleted the ts_pin_ext_input branch October 5, 2026 14:01
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