Rockbox General > Rockbox General Discussion

iRiver H340 orig fw boot

(1/1)

Eric Draven:
Just wanted to run this by you guys... see if anyone else noticed...

I noticed on my H340 that if I press the play button one short and one press-hold in rapid succession, the device boots in the original iRiver firmware.  Was that intended?  If so, since when?  G'day guys!

nls:
I think LinusN made it this way in the bootloader as a fail-safe since the play button is the only button that can be read if the ADC driver doesn't work and booting iriver firmware allows you to flash a new bootloader.

LinusN:
It is a side effect of the so-called "cookie". When the bootloader starts, the first thing it does is to check a special "cookie" in memory. If it is cleared, it continues the bootloader. If it is set to a special value, however, the bootloader starts the original firmware.

The idea is that the bootloader sets the cookie to the special value when it runs, and clears it when it starts Rockbox. Therefore, if the bootloader crashes, the cookie is still set, and if you reboot it will start the original firmware, so you are able to reflash the broken loader.

Now, the double-click behaviour you see is an effect of this, and actually a bug in the bootloader. The bootloader checks if the ON button is held, and powers off if it isn't. This is to prevent Rockbox from starting if the ON button is accidentally pressed in your pocket or bag.

However, the bootloader forgets to reset the cookie in this case, and if the ON button is pressed again very quickly, the player starts again and the memory has retained the cookie value even though it has been powered off, and Rockbox starts the original firmware.

Eric Draven:
Thanks for the replies!

To think I actually thought it was quite cool to have another way of booting the original firmware, and then later realize it was unintended behavior  :D it's still cool just the same.  Thanks again, guys!

dommo:
Yeah I discovered this quite a while back on my H340, put hold on and keep clicking the play button (or whatever you do) and the iriver firmware Hold screen comes on rather than the "Hold switch on, power off" (or similar) of the rockbox firmware. Never thought anything of it though ;)

Navigation

[0] Message Index

Go to full version