release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > STMP37xxRecovery

Warning !! You should not attempt any of these without someone knowledge telling you to do so. Do NOT attempt these instruction if you don't understand what you are doing, or you might permanently brick your device Warning !! These instructions may be wrong, or untested, or whatever

This page documents most common recovery procedures on the SigmaTelSTMP3xxx which can be found in many players. Most of these instructions assume you are working under Linux, or in a virtual machine with Linux.

Bad logical sector size

This problem may affects the following devices (and maybe some others):

Symptoms

The OF doesn't boot anymore (either in USB or normal mode), but Rockbox does and report a logical sector size of 512-bytes.

Explaination

On those devices, the OF has a hardcoded value of 2048 for the sector size. The disk is organised weirdly with a first level partition table in 512-byte sector units and a second level one in 2048-bytes sector units. When running normally, Rockbox exposes the second level one and guesses the logical sector size. If by mistake, the user formats the entire disk without taking care (by flashing a prebuilt boot image by example), the operating system might create a partition table in 512-bytes sector units. At reboot, Rockbox will probe a sector size of 512-bytes and from this point one, the error is impossible to fix because the OF doesn't boot and Rockbox reports 512-bytes logical sector size instead of 2048.

Solution

The solution is to manually fix the second level partition table so that offset are in 2048-bytes sector units. This will restore OF functionality and Rockbox will correctly probe the sector size, putting everything back into order.

Troubleshooting under Linux

The problem can somewhat easily be solved under Linux. The easiest method is to completely reformat the user disk although it can probably be achieved without it, it makes the instructions easier. All instructions must be ran as root.

  • Plug your device, it should be in Rockbox USB mode (or Bootloader USB mode)
  • The device should appear as a drive like /dev/sdX, replace sdX by the actual drive in all these instructions
  • Run fdisk /dev/sdX
  • Create a new table by pressing "o"
  • Create a new entry with "n" then "p" for primary, then "1" for first entry and select "2048" for the first sector, just hit enter for the last sector
  • Change the partition type by hitting "t" then "c" (for W95 FAT32 (LBA))
  • Press "p" to print the table, it should look like this: /dev/sdX1               2048     ......     ......    c  W95 FAT32 (LBA)
  • Press "w" to write and exit
  • Make sure the fdisk manages to sync the disk, if not unplug and replug your device
  • Reformat the partition using mkdosfs /dev/sdX1
  • Run fdisk -b 2048 /dev/sdX
  • Delete the partition by pressing "d"
  • Create a new one with "n" (new) "p" (primary) "1"then "512" (first LBA) then just enter, then "t" then "c"
  • Press "p" to print the table, it should look like this: /dev/sdX1               512     ......     ......    c  W95 FAT32 (LBA)
  • Press "w" to write and exit
  • The problem should be fixed.

Battery is too discharged to even boot

This problem may affects the following devices (and maybe some others):

Symptoms

You device used to work but you let it discharge too long (typically by not using it for a long time). You cannot boot by pressing the power button and when plugging the USB cable, the device either doesn't boot or boots but shutdown immediately, or the device boots to USB mode but doesn't charge because you are using a bootloader which doesn't charge.

Explaination

When the battery is extremely low, the device cannot boot. Even when plugging USB, it may happen that it also fails because some boot stub do some unsafe operation by assuming the device is still charged a little bit. Or the bootloader doesn't support charging and neither OF and RB can be booted to actually charge the device.

Solution

The simplest solution is to boot to recovery mode and upload a very simple stub which does not nothing except setting up charging. Once the device is minimally charge, you can reboot normally and complete the charge using either OF or RB.

Requirements

Both Windows and Linux solutions require that you either download or build the special stub to charge.

Charge firmware file

Downloading the file

There exist prebuilts file for the following devices:

Building the file

This method requires the following things:
  • a working cross-compiler (arm-elf-eabi), see HowToCompile
  • a copy of the source code, see HowToCompile
  • a copy of the latest firmware for your device (see the relevant wiki page for your device)

First you need to compile the bootloader, to do this follow the instructions from HowToCompile and when running the configure script, select your device and bootloader build. After the build, you should get a bootloader-xxxx.yyyy file (you don't need to go further than the 5. Build step in HowToCompile) (xxx is the name of your device, like fuzeplus and yyy is the vendor, like sansa)

Then you need to build the mkimxboot tool in rbutil/mkimxboot. To do so, just cd into rbutil/mkimxboot and run make. It should produce a mkimxboot executable.

Finally, you need to run the tool with the correct parameters. Assuming you are in rbutil/mkimxboot, run:

./mkimxboot -i sandisk-firmware.sb -b bootloader-xxxx.yyyy -o charge_firmware.sb -t charge

sbloader

Downloading the file

There exist prebuilts files, assuming your system is close enough for them to work:

Building the file

We have Linux-only version of it, we can be compiled by run make in utils/imxtools/sbtools in our repository.

Troubleshooting in Linux

With the charge-firmware.sb file on one hand and the sbloader on the other, you need to:
  • boot your device in recovery mode (see the wiki port page of your device)
  • run as root sbloader charge-firmware.sb
  • the tool which report success, the screen will stay black
  • leave the device plugged for at least 15 minutes
  • reset the device, now it should be working and have slightly charged battery

Troubleshooting in Windows

With the charge-firmware.sb file on one hand and the sb_loader.exe on the other, you need to:
  • boot your device in recovery mode (see the wiki port page of your device)
  • run in a command line prompt sb_loader.exe -f charge-firmware.sb
  • the tool which report success, the screen will stay black
  • leave the device plugged for at least 15 minutes
  • reset the device, now it should be working and have slightly charged battery

-- AmauryPouly - 24 Mar 2014
r4 - 23 Apr 2015 - 16:16:22 - AmauryPouly

Copyright by the contributing authors.