StarLabsLtd / firmware

71 stars 5 forks source link

[StarBook Mk VI - ITE] Charging stops intermittently #95

Closed david-mohr closed 1 year ago

david-mohr commented 1 year ago

After the latest update, having followed along with the other charging issues (#89, #90), a new issue has appeared:

Sean-StarLabs commented 1 year ago
80: 47 01 24 00 fc 15 1e 2d ea 15 00 00 02 00 00 f9 
       ^                                                              ^
   Charger is connected                     Charger is supplying 512MA

That looks good to me. The low current is Hybrid power; allows the laptop to draw from both the charger and battery if it needs to (the battery responds quicker).

Ignoring the icon - all behaving well?

divico commented 1 year ago
80: 47 01 24 00 fc 15 1e 2d ea 15 00 00 02 00 00 f9 
       ^                                                              ^
   Charger is connected                     Charger is supplying 512MA

That looks good to me. The low current is Hybrid power; allows the laptop to draw from both the charger and battery if it needs to (the battery responds quicker).

Ignoring the icon - all behaving well?

no unfortunately it is not only the icon. I believe it really disconnects the power for a moment. This becomes clearly visible when replacing the DC jack with the Starlabs USB-C 12 port hub. It will completely disconnect all attached devices, including screen randomly. I tried another dump right after it happened, maybe you can see something

sudo ./ectool -d
EC RAM:

00: 01 0a 00 00 01 00 00 00 00 bb dd 00 00 00 00 01 
10: 00 00 00 00 00 3e 28 00 00 00 aa aa 00 00 00 00 
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
40: 00 31 36 3a 35 30 3a 33 33 00 00 32 30 32 33 2f 
50: 30 34 2f 30 34 00 00 00 00 00 00 00 00 00 00 00 
60: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 
70: 46 00 00 00 16 01 00 00 01 02 04 00 00 00 00 01 
80: 47 01 24 00 fc 15 1e 2d dc 15 00 00 02 00 00 83 
90: 0c 2c 2e 39 00 00 00 00 00 00 00 00 00 00 00 00 
a0: 00 00 0a 00 33 90 14 00 00 00 00 00 00 00 00 00 
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
c0: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

In the meantime I'll go back to EC 1.01 which does not have the issue. I can do some more testing tomorrow.

Sean-StarLabs commented 1 year ago

Thanks, but typically - that looks happy.

I'll try and replicate it, but what I think I'll need is an EC dump when it's stopped; the EC is really quick, so either:

Leave this running to catch the disconnected while :; do sudo ./ectool -d; sleep 1; done > log.txt

Or I can put together a debug build that'll capture any possible reasons (might take a few tries to narrow it down)

david-mohr commented 1 year ago

Here's a two minute capture with multiple disconnect events using your while loop. Hope it helps! log2.txt

PS I found it helped to put the system under a little load to trigger the disconnect more rapidly

divico commented 1 year ago

I also managed to the run the dump loop while experiencing multiple disconnects. This is running 8.36 and EC 1.10, LED purple, battery 56% with max charge set to 60%, Starlabs USB-C 12 Port hub connected with some USB devices and 1 screen.

log.txt

In the last seconds of the logfile I have disconnected the USB-C hub.

Sean-StarLabs commented 1 year ago

Thank you - same thing happening on both, 1.11 will handle that

divico commented 1 year ago

great, thanks, 1.11 looks promising so far. Running for about 8 hours without disconnect. I'll do some more testing and keep you posted by April 11 or 12

david-mohr commented 1 year ago

Unfortunately, even with 1.11, I'm still getting the same problem, except it's now happening before it reaches 100%. The following log was captured at about 88%. LED is red when charging log4.txt

divico commented 1 year ago

I can confirm 1.11does not completely fix the issue, I had several disconnects running 1.11, but in my case they are much less frequent as compared to 1.10and most other EC versions >1.01. I managed to run the dump loop while experiencing a disconnect. In the first seconds of the log the laptop is running on battery (3% left, max charge still set to 60%)) with nothing connected, then I connect the USB-C 12 Port with power/screen/other USB stuff, then it runs fine for a moment before there is a disconnect. Hope it helps

log.txt

Sean-StarLabs commented 1 year ago

@david-mohr That's memory overflow; meant it only had 0xa0 which isn't enough power - will look into it

@divico I'd expect that, new ECs are set to prioritise charging to 5% over anything else; happy to make that configurable though.

Sean-StarLabs commented 1 year ago

I couldn't replicate it, so I've put together 1.12 that should avoid it. If it doesn't, it'll store the exact reason for stoping charging at 0xa0. i.e. in the output of ectool, EC RAM:

00: 01 0c 00 00 01 00 00 00 00 cc 00 00 00 00 00 01 
10: 00 00 00 00 00 3f 2a 00 00 dd 00 aa 00 00 00 00 
20: 00 00 00 00 00 00 00 00 00 00 00 00 ea 00 00 00 
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
40: 00 20 39 3a 35 37 3a 32 31 00 00 32 30 32 33 2f 
50: 30 34 2f 30 34 00 00 00 00 00 00 00 00 00 00 00 
60: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 
70: 41 00 00 00 00 00 00 00 01 02 04 00 00 00 00 01 
80: 47 01 d9 00 fc 15 1e 2d 7d 16 00 00 90 60 01 15 
90: 16 96 33 62 00 00 00 00 00 00 00 00 00 00 00 00 
a0: **07** 00 33 90 0b 80 0a c0 14 00 01 00 00 00 00 00 
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
c0: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

That number means:

1 = Battery Alarm Bit 2 = Battery reports fully charged 3 = Charged to target level 4 = Overcharge Protection active 5 = Battery is over temperature 6 = Slow Charging due to cold battery 7 = Normal

david-mohr commented 1 year ago

@Sean-StarLabs My AU adapter broke over the weekend (removing a plug next to it and the US-to-AU clip split in half), so there's a chance that my adapter was causing some of the problems. I'll get this installed today

divico commented 1 year ago

@divico I'd expect that, new ECs are set to prioritise charging to 5% over anything else; happy to make that configurable though.

Prioritization makes sense, but I'm still not sure that the behavior I observe when battery <5% is really expected. Even with only the Jack connected, the power would disconnect multiple times until it reaches 5%. Above 5% the system has been running well for several days using different charger and USB-C hubs.

If you feel like looking into the disconnects I have when the battery is <5%, I've attached two log files, one running ITE 1.11 and another running 1.12. In both cases I have coreboot 8.37 and only the power Jack and the Starlabs GAN charger connected. I forgot to check the LEDs though.

log ITE 1_11.txt log ITE 1_12.txt

Sean-StarLabs commented 1 year ago

When it's less than 5%, it's at 0.5C, which is 30W. As it's drawing no power from the battery, the second the power draw crosses 30W, the crosspoint switch will reset (you'll see it as the charger disconnecting, or if it's a USB-C display, that disconnecting) as it's an auxiliary device.

divico commented 1 year ago

When it's less than 5%, it's at 0.5C, which is 30W. As it's drawing no power from the battery, the second the power draw crosses 30W, the crosspoint switch will reset (you'll see it as the charger disconnecting, or if it's a USB-C display, that disconnecting) as it's an auxiliary device.

Ok, I sort of understand thanks. I can live with that, it is not a big deal, but it remains something I have never seen with another laptop. I fear this may confuse many other users which don't know about this detail. When you are low on bat and you connect the charger you pay special attention to check if the laptop is indeed charging, specially when you are traveling and you are not sure that the power socket is really working (train, hostel, etc..). Hence, these disconnects will not go unnoticed in many cases. Even worse is that most modern desktop env will give you a warning that the machine will soon hibernate. So you just plugged the charger and few minutes / seconds later the machine tells you it must hibernate... Unless you know the technical detail about the crosspoint switch reset, you will most likely think that there is something wrong with the power socket, the charger or the cable and you will spend time troubleshoot a problem that doesn't exist. Just my 2 cents from a user perspective.

Beside this minor thing, in my case the laptop works very well now. Big thank you for solving the various charging issues over the last weeks so quickly.

Sean-StarLabs commented 1 year ago

It's a rock and a hard place; most laptops would control the power consumption based on available power - that can't be done in coreboot.

Before, we hid the actual status of the battery, and you only really used 90% of it; the top and bottom 5% were reserved to avoid this and overcharging the battery.

Hundreds of requests (originating from concerns about overcharging and calibration running slightly astray) has made it change so you now get full visibility (and a splash more runtime).

I need to re-write all the code that controls the crosspoint anyway (so it's open-source), so I'll see if there's anything we can do when doing that.

david-mohr commented 1 year ago

Seems to be working well for me too. Thanks for iterating with us so quickly!

david-mohr commented 1 year ago

We've had another laptop (running 1.12) that's stopped charging. It won't take a charge via AC or USB and the charge state is below 20% so can't update the bios (8.25). What can we do from here to get it charging again?

Sean-StarLabs commented 1 year ago

The BIOS can't stop it charging, but you'll be able to update the EC via the EFI Shell to 1.13. If that doesn't work, please ping the details to support@starlabs.systems

david-mohr commented 1 year ago

Thanks Sean,

After some more experimenting, it look like a faulty connection between the charger and the laptop. Not quite sure which bit is at fault, but we'll run some more tests next week when we have a couple of the same laptops in the same room. But at this stage, not a software issue.

Sorry for the false alarm!