Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#7505 - Gigabeat Flashwriter - DO NOT USE

Attached to Project: Rockbox
Opened by Karl Kurbjun (kkurbjun) - Sunday, 29 July 2007, 17:24 GMT+2
Last edited by Karl Kurbjun (kkurbjun) - Friday, 26 September 2008, 06:06 GMT+2
Task Type Patches
Category Plugins
Status Assigned
Assigned To Karl Kurbjun (kkurbjun)
Player type Gigabeat
Severity Low
Priority Normal
Reported Version current build
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

DO NOT USE THIS TOOL UNLESS YOU HAVE A JTAG INTERFACE TO RECOVER FROM A BAD WRITE.

Currently this plugin erases the flash and then rewrites it with the file flashwrite.bin. The flash can be accessed at 0x04000000, and it is 1 MB in length.

The flashwriter plugin works for me - that does not mean that it will not erase your flash and leave you with nothing. In fact that is very possible. If a bad write occurs do not shutdown the player, instead reconnect it to the computer, upload a new file and retry. The timeouts for erasing, writing, etc are not setup properly right now and it has gone through little testing.

It is safe to erase and write to the sector located at 0x04050000, it is part of the gigabeat firmware that is only used for images and I have tested this with the 2.x version of the firmware successfully.
This task depends upon

Comment by MichaelGiacomelli (saratoga) - Monday, 29 October 2007, 01:26 GMT+2
Karl: Have you had any more time to work on this?
Comment by Karl Kurbjun (kkurbjun) - Wednesday, 31 October 2007, 18:51 GMT+2
I have not worked on it since I left for China and started the m:robe port. My JTAG cable, desktop system (with a parallel port), and the gigabeat with the JTAG interface connected is still in storage. Once I finally move everything out I plan on working on it again. Are you interested in trying it out? There's some work that will need to be done to the way the bootloader is built, but I think that it was pretty close in terms of hardware initialization. If you want pointers on setting up a JTAG interface I would be happy to help.
Comment by MichaelGiacomelli (saratoga) - Wednesday, 31 October 2007, 18:58 GMT+2
I'd like to see this finished, but I have no time for it at the moment. And when I get time I'm still committed for the WMA decoder improvements. Thank you for the offer though.
Comment by Karl Kurbjun (kkurbjun) - Thursday, 25 September 2008, 07:31 GMT+2
Over a year since the last code update. This adds some more functionality to the flash writer and some error checking (more is needed). The Gigabeat F is now able to boot from flash and shutdown with the included diff. I still do not recommend using this till I am able to get the MD5 sums working so that the code can verify the flash image that will be patched has been tested in hardware. I also need to test this on players other than my JTAG setup. It is /relatively/ safe to use for the backup and restore functions but I would recommend sticking to the backup feature till more error checking is added. This also features dual boot functionality. Note that the MD5sum function reboots the player (I have not traced this bug yet).
Comment by Karl Kurbjun (kkurbjun) - Thursday, 25 September 2008, 07:46 GMT+2
Add some needed error checking to make sure that sectors are not erased/patched without data present when "Install Rockbox bootloader" is run.
Comment by Kyle Kamperschroer (Phalangees) - Thursday, 25 September 2008, 16:52 GMT+2
I'm very excited to see work being done on this again. Thanks for your hard work Karl!
Comment by Karl Kurbjun (kkurbjun) - Friday, 26 September 2008, 05:59 GMT+2
Thanks for the encouragement, it helps me keep interest :). This update adds more of the needed error checking. The timeouts need to be updated/fixed and MD5sum is still not working so I pulled it from the menu for now. All of the other routines work pretty well, but I still do not recommend using this without a JTAG setup. The main code updates needed for dual boot and proper shutdown are now in SVN.
Comment by Karl Kurbjun (kkurbjun) - Saturday, 04 October 2008, 09:18 GMT+2
Here is the latest version of the flash writer. I have tested this with version 3.02 FW and 2.0 FW. 95% of the checks are in place to protect the flash. These are the missing checks that I would like to add:
1) A check to make sure that the charger is plugged in and the player is mostly charged (>80%?).
2) An MD5 sum check after the flash is patched to double check to make sure that it matches a known bootloader release (a byte for byte verification is already done so this is redundant, but can't hurt...).
3) An MD5 sum on the bootloader.bin file to make sure that an untested bootloader is not being written.

There are checks in place to make sure that:
1) An untested OF flash image is not patched
2) A backup of the OF flash is made before attempting a patch
3) The bootloader image is present before attempting to patch the flash (or restore)
4) The bootloader image is not too large for the sector it is being stored on
5) There were no writing or reading errors.

I still need to do the timings properly for writing/erasing the flash. Currently the code does not have any timeouts so if there is a bad flash device it will never stop trying to write to it or erase it.

Once I have the timings right I think this will be acceptable for others to use for flashing (honestly at this point it's pretty safe already), but ideally I would like to get the rest of the checks desired in the code first.

For now though if anyone wants to start making sure their flash image is up to par they can run the "Check flash MD5 (version)" menu option. If an abort message comes up then I need a copy of the flash to verify that it will patch cleanly. A backup can be made by running "Backup Flash and MD5sum". Do not use "Restore Flash Backup" or "Install Rockbox bootloader" until the proper timings are added since these two operations do the erasure and writing to the flash.
Comment by Kyle Kamperschroer (Phalangees) - Saturday, 04 October 2008, 17:14 GMT+2
I attempted doing the MD5 sum check and I got the ABORT error so here is my backup.bin.

Thanks again for all of your hard work Karl. I'm incredibly excited for this.
Comment by Karl Kurbjun (kkurbjun) - Saturday, 04 October 2008, 18:27 GMT+2
Thanks for providing this, I will verify this image's functionality. For the purpose of the flash writer digests do you know which version of the firmware you have on your player? Did you run any of the flash hacks that were provided by shoora? If so I have a backup image of a clean v3.02 image that I will post so people can restore back to a fresh image. If you didn't run any of shoora's hacks do you happen to have a copy of your original GBSYSTEM folder? I am trying to collect full backups of all the different firmware revisions.
Comment by Kyle Kamperschroer (Phalangees) - Saturday, 04 October 2008, 18:39 GMT+2
Yes, I did do some flash hacks that shoora provided. I'll try and do a clean install of the v3.02 firmware.
Comment by Karl Kurbjun (kkurbjun) - Saturday, 04 October 2008, 19:02 GMT+2
Don't worry about doing a clean install; I have a copy of the original 3.02 firmware image and the GBSYSTEM associated with it. I will put a copy that can be used with the restore function once I get the proper timing implemented which shouldn't be too long.
Comment by Kyle Kamperschroer (Phalangees) - Saturday, 04 October 2008, 22:36 GMT+2
Well, I couldn't find a copy of 3.02 but I did find 3.00 so I installed that instead. I got the same MD5 abort message. I've attached the necessary files. If you want the GBSYSTEM folder, I'll have to e-mail it to you because it's 10mb when compressed and flyspray won't allow more than 2mb.

Thanks again Karl.

Loading...