• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category Battery/Charging
  • Assigned To No-one
  • Operating System iPod 5G
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Version 3.1
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by JasonT - 2008-03-25
Last edited by torne - 2010-06-06

FS#8802 - iPod does not charge via an AC -> USB adapter

Can no longer charge my 30Gig iPod Video device with a connector that plugs directly into the wall

Additional Information:
-If I boot into emergency disc mode (hold down select and play on reboot), the device will still charge so I do not think it is an issue with my hardware, or with my AC adapter
-This has worked in Rockbox before, but I don’t typically charge this way so I don’t know when this broke.
-Originally there was a patch I needed to apply to make this type of charging work. At some point, it started working in Rockbox proper. Then, apparently, it broke again.
-I can go back to older builds if someone needs help narrowing down when this broke
-Charging via a USB port appears to work fine.

Closed by  torne
2010-06-06 13:08
Reason for closing:  Fixed
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

USB charging works as of r26626. The GPIO manipulation is based on dreamlayers' patch here, but it uses the new USB charging framework instead of just always enabling it.

Sorry, didn’t include version - last tried this with r16690-080318

sitko commented on 2008-03-26 08:39

I have the same behaviour with my iPod 20 GB Color/Photo.
Last working release by me was r15845-071129.
Than I tried r16290-080212 and bug was already included.

kiese commented on 2008-03-26 10:49

i have the same problem with my ipod nano. it could not charge in ipod software also. usb works.

I hooked measured USB charging current on a 5th generation 30 gig iPod. Only the ground and +5V lines were connected. When running Rockbox r16819, charging current was just under 100mA. When running the original firmware, version 1.3 (latest) the iPod drew 0.42A.

I also felt that USB charging from my computer was too slow in Rockbox when I plugged in USB while holding MENU so Rockbox stays running normally. I didn’t measure the current but based on charge rate I’m willing to bet it’s limited to 100mA. In Device Manager in Windows Vista, the power tab for that particular USB hub on the motherboard showed that the iPod had requested 500mA, but that doesn’t control how much it uses.

Various iPods use the LTC4066 chip for charging and USB power management. For info about the chip, see:,C1,C1003,C1037,C1078,C1088,P12292 Pin 13 (HPWR) of that chip is an input which selects between 100mA and 500mA charging. Perhaps that corresponds to a GPIO bit which Rockbox needs to manipulate.

The current limiting part of the LTC4066 doesn’t apply to Firewire charging, and charging from Firewire in Rockbox is fast.

Same problem here, with firmware downloaded today.
Tried both the Apple wall charger, and a car usb charger.
iPod 30GB Color/Photo

To be more specific, I’m running firmware r17194.

Hi, i’m running version r18339 with USB stack enabled.

iPod is charging from AC adapter but not while connected to USB…

More info can be found here :

I’m wondering if this is the same problem I’m having:

I haven’t tested this in a while but with a AC charger plugged into my iPod with Rockbox booted, the iPod seemed to not get any noticable power from the AC adapter. Certainly not enough to charge the battery or run solely off of the AC adapter.

Spanky requested a task closure on  FS#8319  – is this bug still active?

pjh1 commented on 2008-12-11 11:48

I do believe it is still active. I have a 80gig iPod 5.5G and cannot charge via USB, AC or car charger. The iPod indicates that it is being charged but it is actually discharging. It charges perfectly when booted with the original iPod sw. I have ver 19376 installed.

I will say that something happened in the r192xx builds that made charging awesome. It’s been the best and fastest I’ve ever seen it. Plus, theres a new icon at the top when you’re connected. I’ve got 0 issues on my iPod 4G Color. I have yet to run anything after r19320-ish.

Confirmed on iPod 4G r19450. It changes icon but the animation indicating that a charge is occuring is not happening

What happens if the iPod is connected to USB or a charger when it’s off, so the original firmware in flash sees it while starting up? It may configure hardware properly for USB charging then. (Doing this test with USB connected may require a custom build which doesn’t go into USB mode.)

BTW. I think GPIOD & 8 may be used as the USB charger detection input on 4G and other earlier iPods.

I am having a similar problem.

Simply put, when using a USB cable, my iPod Mini 1G will charge when I let it boot into the Apple firmware, but it won’t charge when I hold the menu button and boot into Rockbox.

Here is an *experimental* and *untested* patch which enables USB charging on 4G, Color/Photo, 5G/5.5G, Mini 2G and Nano 1G iPods. I’ve double-checked the port bits and I made sure it compiles[*]. The patch implements HAVE_USB_CHARGING_ENABLE Rockbox functionality. You need to define that in order for the new code to be included. You’ll get an option at Settings → General Settings → System → Battery → Charge During USB Connection. I don’t know if it’s better to only enable this while USB power is available.

IMPORTANT: The OF does charger detection based on voltages found on USB data lines. This code just enables charging blindly. Only connect USB power sources which can supply over 500 mA or 0.5 A. Don’t try charging from unpowered hubs or chargers which have lower ratings.

You should be able to quickly verify charging via System → Debug → View Battery. On 5G and 5.5G iPods, you could also use  FS#9728  .

[*] On the Nano, you need to define CONFIG_CHARGING for the necessary language entry to be built. I think the Nano ought to be compatible with setting CONFIG_CHARGING to CHARGING_SIMPLE, but I don’t know why that is commented out.

fg commented on 2009-03-03 21:41

I suspect that in a final patch you’ll want to use usb_allowed_current() to see what the host allows (if connected). firmware/target/arm/imx31/gigabeat-s/power-imx31.c implements this properly.

Thanks for pointing that out. Using usb_allowed_current() seems right, but I’m not sure about the way the function is implemented in (see end of file). Why is 500 mA conditional on usb_state == CONFIGURED? Does that mean the USB code will refuse to connect to ports which cannot supply 500 mA? It should be possible to connect iPods to 100 mA ports. What about USB chargers which are capable of supplying 500 mA? (They typically aren’t a USB host.) Is it safe to assume that 500 mA is available if there is USB power but no USB data connection (eg. a timeout or PORTSCX_LINE_STATUS_UNDEF)? Apple detects USB chargers by measuring voltages on USB data lines via the PCF ADC and I guess Rockbox might have to do that?

The current patch is just to confirm that USB charging works when these bits are set. On 4G/Color/Photo/5G/5.5G iPods it would also be useful to confirm that if the third bit is zero, current is limited to 100 mA.

fg commented on 2009-03-03 22:32

There’s actually no clean way to do this. Most OSes only support a single configuration (i.e. they always choose the first one), so if you ask for 500mA and it’s not available you can’t connect, while if you only ask for 100mA you’re guaranteed to connect but you don’t get a useful amount of power. One way to handle this could be to ask for 500mA, and if we don’t get it disconnect (not sure how, maybe just reset the controller?) and try again at 100mA (and don’t charge).

To distinguish between a USB connection and a pure power connection we look for bus traffic, i.e. if there’s no bus reset within some time after connecting, we assume a charger (and therefore 500mA)

Talk to Michael Sevakis (jhMikeS on IRC) for the details, he did the gigabeat S charging code and the current iteration of the USB connection init code.

Something important I forgot to consider: Has it been confirmed that charging is hardware-controlled on iPods?

It’s definitely hardware-controlled on the 5G, via the LTC4066 chip. The 1G Nano has an LTC4066 and 1G Mini has an LTC4055. Those are probably used for charging, although that needs to be confirmed. What about the 4G, Color, Photo and 2G Mini?

I was looking at this bug as a USB power issue, not a charging issue. It seems nobody complains about FireWire charging, and the bits changed in the patch deal with enabling use of USB power and setting the USB current limit. They seem irrelevant for FireWire charging.

While updating the patch to use usb_allowed_current(), I thought of another concern: iPod accessories. Maybe Apple told accessory makers that if they present certain voltages at USB data pins, iPods won’t use more than a certain amount of current. It’s impossible to be sure that every iPod accessory which supplies power to the iPod has proper overcurrent protection, so it is necessary to assume that exceeding the limit can cause damage. If you want to charge from USB chargers, iPod charger detection is necessary. I guess there shouldn’t even be any setting which overrides that.

fg commented on 2009-06-04 19:46

I think we shouldn’t let the usb_allowed_current() issue hold us back. We have lots of targets that don’t check for power allowance when connected, and we can’t even fix that on half of them. It should be fixed eventually of course, but I think getting working charging is pretty important.

The question about charging being hardware-controlled remains of course. Is there any news on that?

loyx commented on 2009-11-30 05:35

I tried the patch, worked perfectly with ipod 4G. Charges with AC Adapter. Doesn’t work on low power HUBs.

Enclosed is the binary

torne commented on 2009-11-30 13:04

Please don’t post binaries on here, there’s no need (the patch is right above), it will go out of date very quickly, and the GPL requires you to provide source if you do.

loyx commented on 2009-12-02 00:37

correction it works on lower power hubs, the hub i was using was just faulty hahah.

yeah, sorry about that.

torne commented on 2009-12-02 10:54

If you can connect to a low power hub with this setting on, then your OS/hub is broken.

Rockbox’s USB stack requests 500mA from the host, and if it’s connected to a hub which cannot provide 500mA on the port (which should include *all* bus powered hubs; only self powered hubs can do 500mA) then the connection *should* fail; if it doesn’t then your operating system is doing USB wrong. Furthermore, when it actually starts drawing 500mA the hub should at minimum switch off the port it’s attached to, or switch itself off entirely, to preserve itself. If this does *not* happen then your hub is faulty ;)

This patch works OK with Ipod mini 1G.

Akur commented on 2010-02-09 22:43

This patch also works with Ipod Video.

This is the only reason I keep the Apple firmware. As soon a non experimental version of this patch arrives, I will certainly stop using the OF.

torne commented on 2010-02-10 10:44

If the patch works for you then you can use it.. it’s perfectly fine as long as you know not to plug it into something which can’t provide enough power.

I am working on a revamp of the USB charging system in rockbox to behave “properly”, but I am not sure how long this will take.

torne commented on 2010-06-06 13:06

USB charging should now work on all iPods. Currently, setting USB charging to “on” means it will charge at full speed when connected to a USB host (i.e. a PC). To charge at full speed with an AC adapter, you need to set USB charging to “force”. I will investigate how to positively identify the Apple charger in the future.


Available keyboard shortcuts


Task Details

Task Editing