Bug 12598 - Battery Charging
: Battery Charging
Status: CLOSED FIXED
Product: SB Radio
Classification: Unclassified
Component: Power Management
: Include FW version in comment
: PC Windows XP
: P1 major (vote)
: 7.4.0
Assigned To: Caleb Crome
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-29 20:43 UTC by Caleb Crome
Modified: 2009-10-05 14:36 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caleb Crome 2009-06-29 20:43:01 UTC
Charging must be complete by MP.
Comment 1 James Richardson 2009-07-07 09:47:44 UTC
Chris and Micky state:  we should really test this feature before we ship to thousands of customers.
Comment 2 Caleb Crome 2009-07-09 10:23:41 UTC
r6471 makes charging work well enough for MPQ build.
Comment 3 Richard Titmuss 2009-07-27 01:09:43 UTC
Reset priority before triage.
Comment 4 Caleb Crome 2009-07-31 17:03:01 UTC
First whack checked in to r6880, non-MP branch.

Works on PA5 and later boards.   Earlier boards won't work right, but will still charge at about 1/2 rate and will die early.

it should not overcharge or over drain the batteries on any boards, but this has not been fully tested.  ymmv.
Comment 5 SVN Bot 2009-08-21 17:07:48 UTC
 == Auto-comment from SVN commit #6351 to the player repo by ccrome ==
 == https://svn.slimdevices.com/player?view=revision&revision=6351 ==

Bug 12598.  Fixed much of battery charging.  Should properly terminate by temperature and timeout.  May still need tweaks, but is basically there.
Comment 6 SVN Bot 2009-08-21 17:08:33 UTC
 == Auto-comment from SVN commit #7214 to the jive repo by ccrome ==
 == https://svn.slimdevices.com/jive?view=revision&revision=7214 ==

Bug 12598.  Fixed much of battery charging.  Should properly terminate by temperature and timeout.  May still need tweaks, but is basically there.
Comment 7 SVN Bot 2009-08-21 17:13:13 UTC
 == Auto-comment from SVN commit #7215 to the jive repo by ccrome ==
 == https://svn.slimdevices.com/jive?view=revision&revision=7215 ==

Bug 12598.  Fixed much of battery charging.  Should properly terminate by temperature and timeout.  May still need tweaks, but is basically there.

Added some new devices to the /sys interface:

battery_charge_rate is a RW variable that allows the host to read/modify how fast (in seconds/mAh) charging happens.
battery_discharge_rate is a RW variable that allows the host to read/modify how fast the MSP thinks discharging is happening.  This is how the host can tell the MSP how much power is being used.  I think this will need to be modified however, to allow for finer grained control.  units are seconds/mah.
charger_event:  tell which charge events happened:  like battery inserted, charging started, stopeed, etc.  see msp430 i2c.h for definitions.
charger_state:  tells what state the device is in:  whether charging is idle, charging, discharging, etc.
cbattery_charge tells the state of charge.  This is a read/write variable, in case the host needs to update the value for some reason.
battery_capacity:  made read/write  in case the host needs to modify.  (For example, to manage multiple battery packs.)
Comment 8 SVN Bot 2009-08-24 11:39:42 UTC
 == Auto-comment from SVN commit #7236 to the jive repo by ccrome ==
 == https://svn.slimdevices.com/jive?view=revision&revision=7236 ==

Bug #12598.  Added thermal limiting so the packs don't get too hot.
Comment 9 Richard Titmuss 2009-09-02 04:19:43 UTC
Application changes for battery status and low power are in at r7368.

I've found the following issues so far:

1. unplug the ac, and the charger_state is reported as 2 (idle) for a few seconds before switching to 3 (discharge). this means that an "on ac" icon is incorrectly shown.

2. quickly reviewing the msp code, charger_state 4 (low battery) does not appear to be implemented.

3. if you power off (i simulated low battery state in the app), then you can't power on at all. the msp has to be reset.
Comment 10 Richard Titmuss 2009-09-03 01:44:14 UTC
I let a battery run out over night. Now it's not detected. 2 of my 4 batteries are not completely flat, so we at least need a backdoor to start charging these.

If it helps, this is the mcu state:


# for a in /sys/devices/platform/i2c-adapter\:i2c-1/1-0010/*; do echo $a; cat $a; done              
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_0
1023
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_1
363
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_10
450
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_11
680
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_12
4
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_13
4
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_14
4
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_15
4
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_2
56
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_3
426
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_4
901
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_5
0
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_6
727
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_7
258
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_8
902
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_9
488
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/alarm_time
4294967295
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/ambient
477
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_capacity
2000
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_charge
0
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_charge_rate
10
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_disable
7
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_discharge_rate
11
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_temperature
639
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_vmon1_voltage
0
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_vmon2_voltage
1129
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_voltage
5203
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/bus
cat: read error: Is a directory
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/charger_event
0
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/charger_state
1
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/driver
cat: read error: Is a directory
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/flash
cat: can't open '/sys/devices/platform/i2c-adapter:i2c-1/1-0010/flash': Permission denied
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/fw
965
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/gp_register
283686952306183
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/input:input2
cat: read error: Is a directory
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/ir
1234
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/kill
238
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/modalias
i2c:msp430
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/msp_buffer
283686965740782
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/name
msp430
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/power_mode
3
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/rtc:rtc0
cat: read error: Is a directory
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/subsystem
cat: read error: Is a directory
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/sys_voltage
17686
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_1
7
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_2
1543
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_4
67438087
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_8
283686952306183
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/time
160
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/uevent
DRIVER=msp430
PHYSDEVBUS=i2c
PHYSDEVDRIVER=msp430
/sys/devices/platform/i2c-adapter:i2c-1/1-0010/wall_voltage
18173
#
Comment 11 Richard Titmuss 2009-09-03 04:04:14 UTC
I'd left that battery plugged in for a while, and just notice that the mcu has not detected the battery. It's not fully charged but appears as AC power on the status bar.
Comment 12 SVN Bot 2009-09-03 12:00:27 UTC
 == Auto-comment from SVN commit #6370 to the player repo by ccrome ==
 == https://svn.slimdevices.com/player?view=revision&revision=6370 ==

Bug #12598.  Implemented low battery state + fixed some broken on/off behavior.
Comment 13 SVN Bot 2009-09-03 12:01:03 UTC
 == Auto-comment from SVN commit #7405 to the jive repo by ccrome ==
 == https://svn.slimdevices.com/jive?view=revision&revision=7405 ==

Bug #12598.  Implemented low battery state + fixed some broken on/off behavior.
Comment 14 SVN Bot 2009-09-03 12:18:10 UTC
 == Auto-comment from SVN commit #7407 to the jive repo by ccrome ==
 == https://svn.slimdevices.com/jive?view=revision&revision=7407 ==

Bug #12598:  The 'power failing' flag is 1<<5, not 1<<4.
Comment 15 Caleb Crome 2009-09-15 20:27:16 UTC
Battery charging seems to be in pretty good shape.  All functionality is there, but It really requires testing. 

We have the 7 QA babies all stuffed with batteries, charging now.    We need to play with them and get some hours on them to look for any corner cases we missed.
Comment 16 Caleb Crome 2009-09-18 10:28:09 UTC
I'm going to call this one fixed since all functionality is implemented.

Any new problems should just go under a new bug.
Comment 17 James Richardson 2009-10-05 14:36:54 UTC
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server!
    * SqueezeCenter: 28672
    * Squeezebox 2 and 3: 130
    * Transporter: 80
    * Receiver: 65
    * Boom: 50
    * Controller: 7790
    * Radio: 7790  

Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes

If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.