Rockbox

Tasklist

FS#9926 - System -> rockboxinfo shows Battery: Charging even if I run on battery

Attached to Project: Rockbox
Opened by Jakub Matoušek (kubiix) - Wednesday, 18 February 2009, 17:25 GMT
Last edited by Boris Gjenero (dreamlayers) - Sunday, 19 April 2009, 22:22 GMT
Task Type Bugs
Category Battery/Charging
Status Closed
Assigned To No-one
Operating System iPod 4G Color
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

In daily build r20040 the System -> rockboxinfo shows Battery: Charging even if I run on battery

Indicators in statusbar and wps display correct non-charging icon
This task depends upon

Closed by  Boris Gjenero (dreamlayers)
Sunday, 19 April 2009, 22:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in r20752
Comment by Jakub Matoušek (kubiix) - Wednesday, 18 February 2009, 17:31 GMT
With Release 3.1 it displays correctly battery level and estimated time left
Comment by Jakub Matoušek (kubiix) - Saturday, 21 February 2009, 15:02 GMT
This happens since r19872: "Make sure 'Battery: Charging' is displayed in the info screen when charging no matter the algorithm (Archos Recorder still specially handled). Have screen refresh itself at 1HZ if CONFIG_CHARGING"
Comment by Boris Gjenero (dreamlayers) - Saturday, 21 February 2009, 21:58 GMT
It works on my 5G 30GB. I guess the bit being tested in charging_state() in firmware/target/arm/ipod/power-ipod.c is incorrect on 4G iPods. Note how other bits are at different locations on different iPods. Someone needs to find how to detect if a 4G iPod is charging. "View I/O ports" in the debug menu may help. Note that other bits report presence of FireWire and USB power.
Comment by Jakub Matoušek (kubiix) - Saturday, 28 February 2009, 20:22 GMT
On iPod Color the GPIO D changes from F0 to F8 when charger is connected
Comment by Boris Gjenero (dreamlayers) - Saturday, 28 February 2009, 22:11 GMT
GPIOD_INPUT_VAL & 8 just detects voltage at the USB +5V input. This does not mean that the battery is charging. It might be full or hardware might not be configured properly (see  FS#8802 ). To properly implement charging_state() you need some way to know that the battery is charging.

BTW I wonder why this bit isn't being used. It was used at one point, eg.
http://svn.rockbox.org/viewvc.cgi/trunk/firmware/target/arm/usb-fw-pp502x.c?revision=16817&view=markup
Comment by Boris Gjenero (dreamlayers) - Monday, 23 March 2009, 06:09 GMT
I think I found the "charging" bit for Photo and Colour iPods: GPO32 & 1. It seems like the word at 0x70000088 may be a latching input for GPO32 bits; the OF writes a 0 and then reads to check if the bit is set.

For other iPods the code still checks GPIOB_INPUT_VAL & 0x01. That should at least be valid for 4G mono, 5/5.5G, 2G Mini and 1G Nano. It might still be wrong for some other iPods.
Comment by Alex Meyer (binaryhermit) - Wednesday, 25 March 2009, 21:52 GMT
The patch seems to work.
Perhaps someone should add this bug to the 3.2 release notes.
Comment by Ali Amir (Ali) - Thursday, 26 March 2009, 00:59 GMT
I can verify the patch solves the problem, and I agree it should be listed as a known issue.
Comment by Boris Gjenero (dreamlayers) - Saturday, 28 March 2009, 06:30 GMT
Thanks for testing. Just to confirm: With the patch, do you see "battery: charging" when the battery is actually charging? Does it go back to displaying remaining time when the battery is full or external power is removed?

I see that 1G and 2G iPods use GPIOB_OUTPUT_VAL & 0x01 to enable and disable the wheel. The same pin cannot be used as an input, so those iPods must also use a different pin.

I don't have wiki access. I'll see what I can do about getting it added to the release notes tomorrow.
Comment by Jakub Matoušek (kubiix) - Wednesday, 01 April 2009, 07:11 GMT
Great work Boris

thanks

Loading...