Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: backhome2017 on August 11, 2015, 03:07:57 PM

Title: Sansa Clip+: How to patch the bootloader to the OF
Post by: backhome2017 on August 11, 2015, 03:07:57 PM
I am just starting out with the developing instructions. As a test I was able to compile the rockbox files and create the .rockbox folder. I was wondering if there were instructions for making adjustments to the bootloader and then patching it to the original firmware binary to create and new firmware. Any help would be appreciated. THanks.
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: saratoga on August 11, 2015, 07:46:18 PM
You can compile the bootloader like a normal build from the configure script and then use the manual install directions to flash it.

The bootloader on  AMS devices is very simple however. The only notable thing it does is present a bootloader USB mode.
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: backhome2017 on August 12, 2015, 08:00:12 AM
Thanks. I am new to this so I wanted to try something simple like changing which button is needed for the dual boot control (i.e. - change holding the left button for the Sansa OF to the right button) just to get use to the coding and the configuration script.
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: gevaerts on August 12, 2015, 08:55:16 AM
Thanks. I am new to this so I wanted to try something simple like changing which button is needed for the dual boot control (i.e. - change holding the left button for the Sansa OF to the right button) just to get use to the coding and the configuration script.

That particular change happens to be the one that's not simple. Dualboot on ams sansas (such as the clip+) is implemented in assembler, very early in the boot process, and is the one bit that is more or less guaranteed to brick the device if you get it wrong.
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: backhome2017 on August 12, 2015, 09:21:39 AM
Hmmm, I guess I need to get use to the assembler coding but it seems that just changing the register that is being read would do it. Obviously, I am just starting and don't know the intricacies to this.
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: gevaerts on August 12, 2015, 09:34:55 AM
Hmmm, I guess I need to get use to the assembler coding but it seems that just changing the register that is being read would do it. Obviously, I am just starting and don't know the intricacies to this.

That will be more or less it, yes, but if you get it wrong you can't boot the OF, which means you can't install new firmware any more, which means game over.
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: backhome2017 on August 12, 2015, 10:18:49 AM
Hmmm. So before I do something crazy, guide me a bit. If I edit the "dualboot.s" file so that for the clipplus instead of reading the GPIO C3 pin as high, it reads, say the GPIO A6 pin (Vol-), would this be the only change necessary to change the dualboot process?

Also, if I did happen to get it wrong and it cannot locate an OF anymore, could I boot the clipplus into "recovery" mode and use an image writer to flash an image and start all over again?? Or would the recovery mode option be dead also?
Title: Re: Sansa Clip+: How to patch the bootloader to the OF
Post by: saratoga on August 14, 2015, 11:19:18 AM
Also, if I did happen to get it wrong and it cannot locate an OF anymore, could I boot the clipplus into "recovery" mode and use an image writer to flash an image and start all over again?? Or would the recovery mode option be dead also?

There is no real recovery mode on the Clip+, so if you brick the player, the only thing you can try is taking it apart, shorting out the flash memory chip, and trying to coax it into booting to USB.