Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

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, 18:25 GMT+2
Last edited by Boris Gjenero (dreamlayers) - Monday, 20 April 2009, 00:22 GMT+2
Task Type Bugs
Category Battery/Charging
Status Closed
Assigned To No-one
Player Type iPod 4G Color
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
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)
Monday, 20 April 2009, 00:22 GMT+2
Reason for closing:  Fixed
Additional comments about closing:  Fixed in r20752
Comment by Jakub Matoušek (kubiix) - Wednesday, 18 February 2009, 18:31 GMT+2
With Release 3.1 it displays correctly battery level and estimated time left
Comment by Jakub Matoušek (kubiix) - Saturday, 21 February 2009, 16:02 GMT+2
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, 22:58 GMT+2
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, 21:22 GMT+2
On iPod Color the GPIO D changes from F0 to F8 when charger is connected
Comment by Boris Gjenero (dreamlayers) - Saturday, 28 February 2009, 23:11 GMT+2
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, 07:09 GMT+2
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.
   ipod_photo_color_charging_detection.patch (0.5 KiB)
 ipod/power-ipod.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comment by Alex Meyer (binaryhermit) - Wednesday, 25 March 2009, 22:52 GMT+2
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, 01:59 GMT+2
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, 07:30 GMT+2
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, 09:11 GMT+2
Great work Boris

thanks

Loading...