Battery wont charge

Started by mauricio, June 23, 2026, 09:45:16 PM

Previous topic - Next topic

mauricio

I have an olinuxino A64, rev. G (two of them), I'm running tests on it, with an attached lipo battery, trying to implement a gracefull shutdown when no main DC current is detected.

uname -r
5.10.180-olimex

cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

For that, I started to look at /sys/class/power_supply/ files.

=== BATTERY SYSTEM ===
capacity: 47
constant_charge_current: 1000000
constant_charge_current_max: 1200000
current_now: 2000
health: Good
online: 1
present: 1
status: Charging
type: Battery
uevent: POWER_SUPPLY_NAME=axp20x-battery
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_VOLTAGE_NOW=3806000
POWER_SUPPLY_CURRENT_NOW=2000
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT=1000000
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=1200000
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_VOLTAGE_MAX_DESIGN=4200000
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=2900000
POWER_SUPPLY_CAPACITY=47
voltage_max_design: 4200000
voltage_min_design: 2900000
voltage_now: 3806000

=== AC PLUG SYSTEM ===
health: Good
input_current_limit: 1500000
online: 1
present: 1
type: Mains
uevent: POWER_SUPPLY_NAME=axp813-ac
POWER_SUPPLY_TYPE=Mains
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_VOLTAGE_MIN=4000000
POWER_SUPPLY_INPUT_CURRENT_LIMIT=1500000
voltage_min: 4000000

My problem is that batteries wont charge on A64 (just tryed one of them, because the other one is far from me), but they charge very well on an olinuxino micro A20.

I'm wondering if this just happening just to me or is an A64, rev. G software/hardware/OS situation.

Also, as aditional info, I'm powering the A64 from an adjustable power source, I can see voltages and current given by it, it's giving 5.2V and ~330mA, even when the limit set to the power source is 2Amps.

This last battery I tried, has two hours stucked in these values (also the adjustable power source)

Tue Jun 23 14:00:38 -04 2026
Status: Charging
Capacity (%): 47
Current (uA): 2000 (<---this value only changes between 1000 and 2000)
Voltage (uV): 3806000

If I unplug the power barrel jack, the values change to this

Tue Jun 23 14:02:34 -04 2026
Status: Discharging
Capacity (%): 47
Current (uA): -478000
Voltage (uV): 3687000


Please also note, that the first battery I tryed, at A64, get stucked at 66% charge, like this

Charging
66
1000 (<---this value only changes between 1000 and 2000)
3896000

At the A20, this battery, after two hours of charge says

14:16:15
99
4176000
124000

So I need to ask:

Do I need to do some extra stuff to get the battery to charge ?

Is this normal behavior ? May I suspect a fail PMIC ?

What may I do to improve the charge ?

Please let me know, thanks

LubOlimex

#1
What is the capacity of the battery?

Is this the exact same battery used with A20-OLinuXino-MICRO (where it charges fully)?

Since you use external power supply, you can easily check if the battery is charging, check the power draw without the battery, and check again with the battery. If the battery is charging the current draw should be considerably higher.
Technical support and documentation manager at Olimex

mauricio

Hello.

Capacity of first battery is 1000mAh. Second one is 3100mAh.

First one charges up to 66% at A64, 100% at A20. Second one 44% at A64, not tested on A20.

Yes, I did poweroff on A64 and look for current, regulated power says 0.001A.

When A64 is on, power or current doesn't go up. It stays ~330mA.

Thanks.

LubOlimex

And you have two A64 boards behaving exactly the same when it comes to the charging?

Did you measure the input voltage at the boards when the battery is connected, is it 5V exactly? The power is applied to the power jack right?

Did you measure the voltages of batteries to see if the voltage reported by the Linux is the same as the voltage measured by voltage meter?

I did some test with A64 board (found revision G to be exact) and 3000mAh battery and it works fine:

Quoteroot@a64-olinuxino:~# cat /sys/class/power_supply/axp20x-battery/status
cat /sys/class/power_supply/axp20x-battery/voltage_now
cat /sys/class/power_supply/axp20x-battery/current_now
cat /sys/class/power_supply/axp20x-battery/constant_charge_current
cat /sys/class/power_supply/axp813-ac/input_current_limit
Charging
4097000
1394000
1200000
1500000
root@a64-olinuxino:~#

You see my battery is nearing 4.1V which is higher the point your stopped, I use the same revision board and the same software. Which excludes a lot of of the things that might have went wrong.

The thing is I can't remember ever seen charging circuit failed in such a way that would charge batteries only half-way. Chances of board failed in such a way are slim, let alone two boards with the same issue (unless both boards got damaged in the same way, e.g. if you connected a battery with reverse polarity connector, but then again they won't charge at all, not just charge up to 44% or 66%). I would suspect power supply somehow can't deliver enough current and maintain voltage or somehow failed batteries. My guesses:

1. Bad external PSU / cable / barrel connector / input voltage at board

Measure 5V directly on the A64 board while battery is connected. PSU display alone is not enough.

2. Battery/protection/connector issue

Especially since both A64 boards behave the same. Test with new Li-Po. Double check Li-Po connectors.

3. Maybe try to re-write the base image and use the default config settings, remember to once reboot the software to load optimal defaults. Maybe try to increase the charge current:

Quoteecho 1200000 > /sys/class/power_supply/axp20x-battery/constant_charge_current
cat /sys/class/power_supply/axp20x-battery/current_now
Technical support and documentation manager at Olimex

mauricio

Hello.

I had only one now, the other is with my customer (and see below please, now neither one).

Yes, I measured the input voltage at jack barrel 5.2V, and at pin1 on 40 pin connector 5V.

Almost impossible to connect batteries reversed, they have jst ph connectors attached.

I've tried olimex original 5v 1.2A transfo, another 5v 2a transfo, and an adjustable power source.

Sadly I was on the middle of this investigation when the A64 return this output through serial at boot

Starting kernel ...



[    0.988284] sun50i-de2-bus 1000000.bus: Error couldn't map SRAM to device

[    0.988831] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO

[    1.323668] sun8i-dw-hdmi 1ee0000.hdmi: Couldn't get regulator

[    1.324092] sun4i-drm display-engine: Couldn't bind all pipelines components

[    1.340432] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO

Loading, please wait...

[    1.855559] BUG: Bad page state in process udevadm  pfn:4511b



[    1.861950] BUG: Bad page state in process udevadm  pfn:4517c

[    1.944754] BUG: Bad page state in process udevadm  pfn:bfbc5

[    1.950715] BUG: Bad page state in process udevadm  pfn:49eb4

[    1.956618] BUG: Bad page state in process udevadm  pfn:41080



Since then, it wont work, I just can hear a periodoc "tic" comming from axp803 (guessing).

I'm now with the plan to identify burned components, aventually to purchase RAM, an A64 IC and an axp803 pmic to replace them.

If it doesn't work, you'll have me purchasing another olinuxino A64 ... I need this thing.

Thanks

LubOlimex

#5
> Almost impossible to connect batteries reversed, they have jst ph connectors attached.

Yes, but the pinout assignments are not standard. Some batteries have the + and - in the jst connector swapped. You need to double check every different battery and match the + and - of the Olimex board - notice the on-board connector has white print "1" that indicates the "+" pin. But still it probably should just kill the charger circuit not alter it to work until certain point.

About the new problem - first try re-writing the SD card, some of the error messages might be due to corrupted image. Yes, chances are slim but it cost you nothing to first test with a fresh image or another SD card.

This sound that you hear can be also from some capacitor or inductor around the PMIC.

If you start changing the components first test all tests pads on the boards for the voltages; then inspect and measure around the components around the AXP803, finally try replacing the AXP803, we have it here:

https://www.olimex.com/Products/Components/IC/AXP803/

In any case double check why this might have occurred, since we test the boards with a battery here, chances of receiving board with such a problem are already really low and then having two like that is straight up impossible.
Technical support and documentation manager at Olimex

mauricio

Hello.

Yes you are right, some of the batteries come with diferent pinout position, but is not the case here, they are both the same and good for the A64 and A20.

Ok, I tried a new clean SD and image, same results, the "tic" is there.

Change parts, its just a last resort to try to get it back ... and to try my luck. I know its very hard to change in a good manner this small and BGA IC's.

I used AI to elaborate some tests, based on revision G schematic. By now, I'll remove L17 and L15, because they showing almost no resistance to ground, with them removed I'm specting to find if the A64 is short circuited.

Hopefully I'll came back with a happy end

Thanks