Rockbox Technical Forums

Third Party => Repairing and Upgrading Rockbox Capable Players => Topic started by: Jason Arthur Taylor on October 18, 2019, 10:28:03 PM

Title: Question about select-pressed, plug in, usb-bootloader-startup mode
Post by: Jason Arthur Taylor on October 18, 2019, 10:28:03 PM
I'm struggling to understand some stuff regarding my player. 

Allegedly if your player is off, and you press select, and then you plug your mp3 player into a computer, it goes into usb bootloader mode.  Saratoga said that this code doesn't need to do anything fancy with the file system.  See http://forums.rockbox.org/index.php/topic,47532.msg226413.html#msg226413 .  Is this really true?  The reason I ask is that my machine says a usb device has connected, but it cannot load any drivers for it.  Essentially the mp3 player isn't presenting itself as a storage device.

I am wondering if this code needs to write something to the file system to work.  Does anyone know?

Where exactly is the code for this?  I'd like to review it to see what it is doing, but I am lost.  I was looking at https://git.rockbox.org/?p=rockbox.git;a=blob_plain;f=bootloader/main-pp.c;hb=7cb1e5a because it seems to go to "plug usb cable" mode where a similar thing happens.

If the file system is corrupt, attempting to write to it is a bad idea, and it could cause the device to hang, which would explain this symptom as well as the fact that upon boot up the rockbox logo is visible, and I can boot into either firmware, but once it seems either starts to write it hangs.
Title: Re: Question about select-pressed, plug in, usb-bootloader-startup mode
Post by: Bilgus on October 18, 2019, 11:00:31 PM
The Sansa Clip(s) are very limited in what the hardware provides as far as peripherals,
pretty much everything is provided by emulation by the software on the flash chip
Unfortunately, once the flash gets corrupted then the software can't do its job.

On top of this the flash tends to go read only at end of life and then you also can't fix the corruption.
Oh, before you ask, NO, no one has figured out how to replace the flash chip.

Is this the fault of rockbox No; Does the OF suffer the same fate, YES only faster since it does tons of writes rebuilding its internal database and is far more brittle to read errors.

Can this be prevented? No, hardware wears out and Sandisk didn't give you a way back.

Can it be slowed down, Yes the multiboot bootloader allows you to run rockbox from a sd card, both prior to flash going read only, and once it inevitably does, assuming the bootloader is still intact.




Title: Re: Question about select-pressed, plug in, usb-bootloader-startup mode
Post by: saratoga on October 19, 2019, 02:11:06 PM
I am wondering if this code needs to write something to the file system to work.  Does anyone know?

The boot loaders usually work without a file system, so I don't think so.

Where exactly is the code for this?  I'd like to review it to see what it is doing, but I am lost.  I was looking at https://git.rockbox.org/?p=rockbox.git;a=blob_plain;f=bootloader/main-pp.c;hb=7cb1e5a because it seems to go to "plug usb cable" mode where a similar thing happens.

That is the bootloader for the old portal player devices (ipods, e200, etc).  If you're on a newer sandisk player, you'd look at the as3525 bootloader in that folder.

If the file system is corrupt, attempting to write to it is a bad idea, and it could cause the device to hang,

Writing to a corrupt file system won't cause a device to hang.  If the flash is dead, it might hang trying to initialize the flash though.