Rockbox Technical Forums

Third Party => Unsupported Builds => Topic started by: massiveH on June 11, 2008, 10:41:38 AM

Title: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on June 11, 2008, 10:41:38 AM
EDIT: Please see post 15 for updated bootloader file and changes.
EDIT2: Patch Submitted http://www.rockbox.org/tracker/task/9202

I use my H340 in the car alot.  However, the firmware on the bootloader page is very outdated, and does not like being turned on by being plugged in.  It appears that I have to press the play button on the player to make it boot past the "bootloader charging" screen.  This got annoying, I downloaded the source, and commented out that code that halts the bootloader on the charging screen when a charger is present.  I have built this bootloader into the 1.31K H320/H340 official firmware and bootloader cvs r17713m-080611.  I want my music to resume as soon as the car started, and this does that.  This build works perfectly for me, but usual disclaimer, if it messes up your player, it's not my fault.

Again, this bootloader is A) Updated and B) does not stop on the charging screen when plugging in a charger, it simply boots as normal and C) NOT THE OFFICIAL BOOTLOADER.

Linky Linky
http://rapidshare.com/files/121703450/H300.hex.html
Title: Re: H320/340 Car compatible custom bootloader build.
Post by: massiveH on June 18, 2008, 01:38:37 PM
Anyone finding this useful? Am I the only one that uses the firmware this way/likes it this way? Feedback please?
Title: Re: H320/340 Car compatible custom bootloader build.
Post by: rogue on July 09, 2008, 08:58:37 AM
Hey,

I just joined the forum to reply to you.  :D

Thanks for doing this, and I'll be giving it a try soon.  I don't have a car, but I'm annoyed at the screen when I sit the H340 in my dock.  I'd like the backlight to go out -- plus the device goes into charging mode when it's plugged in.

Am I mistaken in thinking that the drive will also show up as normal on my desktop?

Thanks!

m a r
Title: Re: H320/340 Car compatible custom bootloader build.
Post by: massiveH on July 14, 2008, 09:14:51 AM
I didn't touch any of the "USB Bootloader" code, so I'm pretty sure it still enters "USB Bootloader" mode.  I only removed the code that stops it from entering Bootloader charging.  If your cradle only has power, it will boot normally and not hang up on the USB mode.  If you want, I could remove the USB part too.

I MUST warn you though, if the Bootloader's USB code is removed, your player WILL NOT boot if the harddrive is bad, that is the whole point of the bootloader's USB mode.  This problem of not actually showing up as a disk has been resolved though, so try the one I've already compiled, and see if it shows up. 

I guess a possibility that can be done is make the player enter USB Bootloader mode if the user holds down a button, or boot into rockbox like normal if no button is held down.  I'm not exactly sure the ramifications of this, but I know something like this is done to enter the stock firmware.  Anyone have input?
Title: Re: H320/340 Car compatible custom bootloader build.
Post by: massiveH on July 16, 2008, 05:54:44 PM
I have now worked a bit more on this for folks that use USB and power cradles.  This new version will boot normally into rockbox if the power plug and/or the usb cable is inserted.  The bootloader will use "USB Bootloader" if you hold the A-B (Mode) button (bottom right) on the player or the remote.  Also, even if the HOLD switch is enabled, the unit will still boot into rockbox, but this should be the desired result when hooking it up to a power source.

http://rapidshare.com/files/130237255/h300.hex.html
Title: Re: H320/340 Car compatible custom bootloader build.
Post by: ViperKnight on July 16, 2008, 11:20:16 PM
I have now worked a bit more on this for folks that use USB and power cradles.  This new version will boot normally into rockbox if the power plug and/or the usb cable is inserted.  The bootloader will use "USB Bootloader" if you hold the A-B (Mode) button (bottom right) on the player or the remote.  Also, even if the HOLD switch is enabled, the unit will still boot into rockbox, but this should be the desired result when hooking it up to a power source.

http://rapidshare.com/files/130237255/h300.hex.html
If this does what I understand it to do.....you are a bloody genius!! :D

I'm using my H340 as part of a CarPC setup (mainly as just an external HDD) and it's a pain in the ass having to turn the player on and wait for it to boot Rockbox before the ignition.  Otherwise, when the computer boots, the H300 immediately just goes to the USB bootloader screen.  Since I don't have the DC power plugged in as well, this ultimately drains the battery.

Seeing as all my music is on the H340 (the carPC itself only has a 40GB drive which I leave for videos + games), if Windows boots without the Iriver connected it chucks a hissy fit :(

Hopefully this solves my problem  :D
I'll post again if it works.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on July 17, 2008, 07:15:33 AM
Yep ViperKnight, this will solve your problem, just make sure USB Charging is enabled in rockbox's options.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: ViperKnight on July 25, 2008, 05:54:04 AM
hmm...

Booting using the charger works.  But for some reason the bootloader won't go past the Voltage reading when booting with USB.  Any ideas?
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on July 25, 2008, 07:18:34 AM
Did you use the second one I posted?
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: ViperKnight on July 27, 2008, 06:12:33 PM
Pretty sure I used the second link.

However, now my h340 refuses to get past the voltage reading with a normal start (just hitting play, no cables).

Hopefully my HDD isn't starting to die.  Might have something to do with the cold weather though.

EDIT:

Righto, managed to get it into rockbox by booting it holding A-B as well (no cable though).
Then reflashed with the second link just incase and it seems to work now  ;D

Hopefully it stays working.  I'm guessing it was getting stuck in a loop or something previously as the hard drive would spin up and keep spinning constantly but didn't boot.

EDIT 2 (29/7):
Seems to be doing it again.  But:

I think I've narrowed the problem down.  The USB boot works fine except when the player has been shutdown by the "Idle Power-Off" timer.  After Idle Power-Off it just keeps freezing at the Voltage display regardless if I start it by plugging in the charger, USB cable or just normal power-on.

To fix it, I booted into the original firmware, plugged the USB in to connect it to the computer, then unplugged it and turned it off.  From then the USB booting works fine again.  I might download the code and have a look.

EDIT 3:
Yep....it seems to be a problem with the Idle Power-Off setting.  Maybe it's just my iriver doing it.  I'm getting the most current Rockbox build just incase it was fixed.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on July 31, 2008, 01:09:20 PM
@ViperKnight:

I tried to replicate the bug that you presented, but I was not able to.  My bootloader does not freeze at the voltage.  What exact model of H3xx series do you have?  If more people could test this, we could narrow down the root cause.  But you seem to be the only other user to try this bootloader build, so I'm not sure the exact cause.

I use the H340 (with a 60GB hitachi drive)
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: ViperKnight on August 02, 2008, 12:55:51 AM
I'm using a H340 with original Toshiba drive.  Soon to be replacing the Battery since it doesn't hold very much charge.  I have changed the battery before but the new one ballooned and I had to put the original back in.  Maybe the HDD isn't quite back in properly.

I can tell you, that the hard drive does spin up when it freezes at the voltage.  From there it keeps spinning and does nothing.  I've gone back to the original rockbox bootloader and it all work fine though  ???

I also was unable to use the USB bootloader mode (with holding A-B) with your bootloader.  Maybe it's all related somehow.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on August 04, 2008, 10:51:06 AM
Well, ViperKnight, this totally happened to me yesterday while driving to a concert.  It would lock up at the voltage reporting.  I have no idea if the harddrive spun up though, as I was in a car.  After the concert, however, it started up perfectly fine.  I had no charger or USB cable to try and 'unfreeze' it.  When I tried booting into the original firmware, it started fine, but duing the original firmware's boot sequence, it stopped and said "CHECK HDD CONNECTION" on the bottom, which I don't know what could cause that.  The ATA init is after the original firmware part of rockbox's bootloader, but I'm not an expert in this.  This is what leads me to believe it may be in rockbox's shutdown, but not sure...

I'm not exactly sure if it will enter "USB Bootloader" when it freezes where  it is (the voltage prompt), as the bootloader itself appears to be freezing.  There must be something being done to the harddrive on shutdown that may cause this, but no idea...  If I had a debugger, I could easily find the cause of this.  I will continue testing, but I can't get it to happen every time, and it's only happened once.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: ViperKnight on August 04, 2008, 07:48:00 PM
Hmm....I've never got the "Check HDD" error ???

All that I can say to help is that the issue is somewhere between the voltage check and the shortcut to boot the original firmware.  No matter the freeze I could always boot the original firmware.  Just not rockbox. 

I'll have a crack at looking at the code, although I'm relatively new to C (have done other languages), to see if there's anything I can spot.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on September 04, 2008, 02:08:33 PM
Updated patch to re-include "Bootloader Charging" mode.  Now, when booting with a power cord in and holding the Mode (A-B) button, it will enter "Bootloader Charging".

http://rapidshare.com/files/142635165/H300.hex.html
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: XavierGr on September 25, 2008, 08:31:36 AM
Does the latest one has the RTC wake up alarm function enabled?

Thanks for your work, I will put one of my H300's in my car, with the power cable always plugged in. That way when the engine starts (and the power cable set to on) the player will start automatically and start playing music.

Edit: Just saw the patch, it seems it is not enabled. Against which revision of rockbox is your patch?
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: pwhodges on December 10, 2008, 10:33:00 AM
USB bootloader mode doesn't work for me either in this version, but the patches themselves work as advertised.

Paul
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: fatoldpig on February 27, 2009, 05:10:08 PM
Pretty sure I used the second link.

However, now my h340 refuses to get past the voltage reading with a normal start (just hitting play, no cables).

Hopefully my HDD isn't starting to die.  Might have something to do with the cold weather though.

EDIT:

Righto, managed to get it into rockbox by booting it holding A-B as well (no cable though).
Then reflashed with the second link just incase and it seems to work now  ;D

Hopefully it stays working.  I'm guessing it was getting stuck in a loop or something previously as the hard drive would spin up and keep spinning constantly but didn't boot.

EDIT 2 (29/7):
Seems to be doing it again.  But:

I think I've narrowed the problem down.  The USB boot works fine except when the player has been shutdown by the "Idle Power-Off" timer.  After Idle Power-Off it just keeps freezing at the Voltage display regardless if I start it by plugging in the charger, USB cable or just normal power-on.

To fix it, I booted into the original firmware, plugged the USB in to connect it to the computer, then unplugged it and turned it off.  From then the USB booting works fine again.  I might download the code and have a look.

EDIT 3:
Yep....it seems to be a problem with the Idle Power-Off setting.  Maybe it's just my iriver doing it.  I'm getting the most current Rockbox build just incase it was fixed.
i'm having the same symptoms. my h140 won't power up anymore so i'm trying to use my h320 and i only use in my car.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: fatoldpig on March 06, 2009, 06:13:35 PM
i can't boot into roxbox anymore with this firmware. it just freezes on the voltage screen. i really like to be able to boot to rockbox with the car adapter plugged in. please help!!
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: lwizard on June 03, 2009, 06:33:05 PM
it seems that the problem is not in the patch but in the new bootlader svn.
Why noy appling the patch to the official firmware release? (v5)
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: larry_llama on February 20, 2012, 08:31:28 PM
My trusty car unit died (rockbox'd ipod mini) and I've dug out my old 320 to use it in the car - does anyone have these patches still? the links are dead. I would love for the unit to boot on power on. I had my ipod mini set up this way and it was just fantastic.

Also, my battery is completely dead in this unit and it's hard to boot it up since it tends to dislike booting rockbox when the power is applied. It seems like if I unplug it and hold power on while plugging it in then it works. It's kind of a pain though. In a perfect world, I would have it automatically boot to rockbox upon applying power, and when power removed it would pause and then shut down within 10 seconds (I get maybe 30 seconds of playback on this battery)

Any help is appreciated - if you have the patches or better yet the old patched bootloader that would be just great.

Thanks!
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on February 20, 2012, 08:56:13 PM
My trusty car unit died (rockbox'd ipod mini) and I've dug out my old 320 to use it in the car - does anyone have these patches still? the links are dead. I would love for the unit to boot on power on. I had my ipod mini set up this way and it was just fantastic.

Also, my battery is completely dead in this unit and it's hard to boot it up since it tends to dislike booting rockbox when the power is applied. It seems like if I unplug it and hold power on while plugging it in then it works. It's kind of a pain though. In a perfect world, I would have it automatically boot to rockbox upon applying power, and when power removed it would pause and then shut down within 10 seconds (I get maybe 30 seconds of playback on this battery)

Any help is appreciated - if you have the patches or better yet the old patched bootloader that would be just great.

Thanks!

I found my old H340, dusted it off, and it had the patched firmware still in the root  ;D  It appears my post on the wiki about this seems to have been removed for some reason...  I can't believe this functionality was never added to the official build, maybe people just didn't care...  Oh well, here is the file.

h300.hex with mod (http://randolphd6.com/files/h300.hex) MD5: c4c8e80a5cc89c80aa306060118fb519
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: larry_llama on February 20, 2012, 11:57:12 PM
Thanks! I'm going to give it a try. I'm very excited you were still monitoring this. I thought it was a long shot...
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: guzzi75 on February 21, 2012, 04:51:48 PM
Thanks also, i looked to your mod unsuccessfully until now.
I wanted to give it a try.
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: larry_llama on February 21, 2012, 07:29:05 PM
I tried it and had some problems - namely the boot froze at the battery voltage line.

Then I used the rockbox installer to re-install the current stable build. But your patch must have remained because it does boot upon application of power now.

Occasionally I get an error such as i0b:line-f at bootup. If I turn the machine off and then plug the power in again, it seems to boot fine the second time. I can't discern a pattern yet of what causes that error.

Thanks again for putting this together. I'm assuming development of this target has slowed to a stop but if any devs are listening, it certainly would be nice for the official bootloader to allow for boot-on-power-connect  :)

THanks again!
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: massiveH on February 21, 2012, 09:28:19 PM
Glad to have helped.  That link should remain, didn't use crappy rapidshare this time...
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: larry_llama on February 23, 2012, 04:38:43 PM
So - I get that error every time I start up if the player has been off for more than a few minutes. If it's only been powered down for a short time, the wake-on-power works fine. I'll look deeper into this when I have more time to spend on it :-)
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: galapogos01 on January 18, 2014, 11:41:37 PM
I realise this is a bit of a thread mine, but will try my luck anyway as it's the most relevant thread.

I did a similar mod to this firmware a while back, to get the H340 to direct boot and restart playback when the ignition was turned on in my car (i'd connected an appropriately wired charger to the DC input of the H300).  It's worked well for approx 10 years.

I recently got a new head unit with USB functionality, and would like the H300 to start up, charge and present itself as a USB disk when power is applied.


Any ideas on the best way to achieve my desired outcome?  I think this firmware is close, but need the rockbox build to correctly enable the charge function on bootup.  Alternately I could try to hack the USB charge function into the bootloader, but as the svn bootloader is busted this wont work.

Cheers,
Jason
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: galapogos01 on January 20, 2014, 02:28:49 AM
Long story short;

I found this post -- http://forums.rockbox.org/index.php?topic=24215.15 -- The previous known ok bootloader: 19309.  To check out this revision using git,

git reset --hard 815998c6693998b7d7a3a523058ff0988e735d27

I then edited the bootloader to call usb_charging_enable(true); right before the USB bootloader loop; this allows the device to charge successfully! 

Calling it before handing off to Rockbox did not resolve bullet point three above; Rockbox must be resetting the GPIO pins, causing the charge mode to disable if USB is inserted when Rockbox boots.  Bug?

Cheers,
Jason
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: galapogos01 on January 20, 2014, 02:52:39 AM
PPS:  If you brick your player with a bad SVN firmware, this trick worked for me to get back into the stock firmware.

Plug DC input into player, boot player to hang, enable hold, then hit reset button. 
Title: Re: H320/340 Car compatible custom bootloader build. (Update: Added cradle support)
Post by: guzzi75 on January 12, 2015, 06:50:30 PM
hello,
Wanted to use my H340/250gb again :)
the battery was dead from a while. Got a new one, a 2200mah. whats interesting is that it comes nearly full charge. the H340 is booting up and playing again :)
Man, this material is rock ;)