• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Battery/Charging
  • Assigned To No-one
  • Operating System iPod Nano
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by oblib__ - 2007-03-30
Last edited by torne - 2010-02-10

FS#6940 - Nano Car Adapter Mode enabled

All I did was enable the CONFIG_CHARGING for the nano, and set the proper GPIO bit in power-ipod.c. I don’t know what the other consequences are of enabling CONFIG_CHARGING, so please let me know if there are any side effects.

To enable, go to settings→general settings→system→car adapter mode, and you can also look at general settings→display→lcd settings→backlight (while plugged in)

Closed by  torne
2010-02-10 13:40
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

This has been fixed in r24581 - the correct GPIOs were already checked but CONFIG_CHARGING had not been enabled.

You probably also want CHARGING_MONITOR instead of CHARGING_SIMPLE… look at  FS#6891 

Can you tell me what the difference is? Both of them work for enabling car adapter mode, which is what I was after.

I may be entirely pulling this out of my ass, but I believe it determines what controls the charging.

Added support for +12V charger pin. Someone with a firewire charger please verify. After enabling the settings in the original post, you should be able to plug in the charger and see a plug symbol show up on the main screen of rockbox-default, and then if you unplug while playing, the music should pause.

Oops, I also meant to change the CONFIG_CHARGING mode to CHARGING_MONITOR. Could a developer confirm that I want CHARGING_MONITOR? It makes sense, since I think that is what the nano does (just monitor) but I can’t tell by looking at the code what it does exactly.

After perusing the code, the only thing I can see the CHARGING_MONITOR vs CHARGING_SIMPLE doing is allowing a flag (charging_state) to be set in powermgmt.c that tells whether the ipod is CHARGING or DISCHARGING. I don’t see any reason not to use CHARGING_MONITOR.

There seems to be a problem with the syntax of your conditional in power-ipod.c. I’m not familiar with the syntax of that kind of conditional, but with that applied, my ipod remains in charging mode all the time. Changing the line to read return ((GPIOL_INPUT_VAL & 0×08)?false:true); worked for me, but that breaks the USB compatibility.

Hmm, works fine for me from both the +5V USB pins and the +12ish V firewire pins. Anyone else care to try to verify?

Awesome work! We’re almost there!

oblib, I can verify that your latest patch works (the latest, with CHARGING_MONITOR mode). When the vehicle is first turned on the iPod is powered on and when the vehicle is turned off the iPod is paused. This is precisely what I had in mind.

However, there does seem to be a bug. After the vehicle is turned off and turned back on again while the iPod is still powered on it crashes with a panic error. I can’t seem to find why this is. The “now playing” screen is shown but quickly goes blank except for the theme and this text in the upper-left corner:

I then have to reset the iPod.

“Stkov” is mentioned in \firmware\thread.c if this helps.

Interesting, I haven’t seen that. What I have seen though, in a similar situation (power goes off then on again fairly soon), is that the nano will not recognize the external power. I figured it was just missing the reapplication of power, and a reset fixed it. I will take a look into this kernel panic when I get some time. Can anyone else confirm or deny this bug? Can anyone else fix it?

Follow up: the latest revision of this patch appears to work as intended. I cannot replicate this message on other Nanos so I’m guessing this message is due to a faulty unit. Thanks for the great work! I hope this patch gets implemented in the daily builds.


Available keyboard shortcuts


Task Details

Task Editing