[One (M9) Android Development] Sneakyghost:
....

Error Handling Strategies for RUUmode/Fastboot

​

IF IT SAYS "FAILED" do NOT immediately reboot the device If you reboot with a FAIL your device could brick! If no flash is being accepted you have to find out what is causing the malfunction before rebooting your phone. Keep it alive while trying to figure out the error. It might be your cable, your USB ports (don’t use hubs! Always direct-mainboard connections), it might be USB 3.0 which is not good yet, it might be bad configuration of your ADB and Fastboot...

The least dangerous FAILED messages are listed below and are safe to reboot (below this section you find CRITICAL errors, please observe):

Safe to reboot / Flash didn't happen Errors (if you encounter one of them, you can just reboot. Nothing changed):

- 10 RU_MODELID_FAIL (MID in android-info.txt does not match phone’s MID)

- 12 signature fail (unknown yet but safe to reboot)

- 23 parsing image fail (means something wrong with the image in the zip)

- 24 android-info fail (means something wrong with android-info.txt in the zip)

- 32 header error (means the zip couldn't be read and unzipped properly)

- 41 Wrong Model ID (means its not the right device)

- 42 Wrong Customer ID (wrong CID means you gotta swap CID first as explained below)

- 90 pre-update FAIL (means it only flashed aboot and you have to run the process again immediately to flash all other partitions). The new M9 htc_fastboot.exe now auto-reboots on Error 90! If it tries to boot to your Android System, force it back into download mode - the flashing process will continue again by itself. If it doesn't auto-commence, restart the flashing process as in Step 3.

- 99 UNKNOWN usually indicates you are S-ON, sometimes other Security related issues.

- 130 wrong model ID (seems its the same like 41, just that it shows in the FUU as 130.

- 155 seems to indicate different things. It can mean: 1.) You need to relock bootloader (If S-ON); 2.) You cannot run the RUU/FUU because the software versions of ROM, Firmware and RUU/FUU don’t match.

- 170 Check USB - FUU won’t run because of not working ADB.​

In fact, if it aborts before the "(bootloader) start image[hboot] unzipping & flushing..." line it actually didn't write anything and you can probably just reboot. If you see it flashing stuff though (the stages after that line) and then it stops with a FAILED, chances are a little higher that something is now broken. In that case do NOT reboot but do as i said above.

For Error “10 RU_MODELID_FAIL” do:

- check that the Model ID in android-info.txt matches your phone’s Model ID.

Typically, making your phone “SuperCID” makes it ignore CID and MID mismatches alike. However, lately we have noticed HTC has changed that behavior. MID mismatches are not ignored by SuperCID anymore. You will need to unzip my firmware package, change the MID in there to your MID and rezip it. Or, alternatively, change your phone’s MID, which is a bit trickier.

To un- and re-zip, please refer to Post #5 of this thread for more information!)

For Error 12 “signature fail" do:

- might indicate that a signed firmware package is required. This would only happen with S-ON phones though.

For Error 23 "parsing image fail" do:

- change image names in the zip to stock image names like “hboot.img" or “radio.img" or whatever failed there....

For Error 24 "android-info fail" do:

- check that your ZIP isn’t some HTC OTA or anything thats got no android-info.txt - those cannot be flashed with fastboot flash zip nameof.zip command.

- check that your zip has a good MD5 and is not broken, check android-info.txt etc...

For Error 32 "header error" do:

- Sorry i haven’t found the exact cause yet and don’t know a definite solution.

- Make sure there is only one . (dot) in the filename, before the extension. fastboot reads anything after the first dot it sees as the extension. If that is not zip, it fails.

- If that doesn't help, you can also try: make the zip new with recommended settings, re-run the command, check your connections...

For Error 42 "Wrong Customer ID" and: 41 "Wrong Model ID" do:

fastboot getvar all

Read that output, take note of your CID and MID and then edit the "android-info.txt" in your firmware.zip accordingly (For Wrong MID change the MID in the text, for wrong CID add your CID to the text).

Alternative method for MID and CID errors:

go SuperCID. Do:

fastboot oem writecid 11111111

You can change back to any desired CID after a successful firmware flash. Notice: this command only works on S-OFF phones (which you have already of course or else you wouldn't be here).

For “pre-update FAIL 90 ..." do:

- Let the phone reboot itself into Download Mode. If it doesn't boot to download mode, force it back there (From Android with adb reboot download or with the button method, see "step 1").

- If the flash does not auto-resume, run the same flash command again which you just ran (press arrow up on your keyboard to get to the previous command in console)

For “Error 99 UNKNOWN" do:

- Check with other zip’s if they work!

- Check if your S-OFF is correct

- You are S-ON? Then almost definetely this means the ZIP is not signed - get an unmodified zip!

For “Error 130 wrong model ID" do:

- Please refer to Error Code 41/42.

For “Error 155 relock bootloader" do:

- Since my thread works only with S-OFF phones anyway, this error can be read as: you need to S-OFF first!

- Error 155 can mean that you need SuperCID. On a few occasions this was shown when the RUU/FUU refused to run because of a wrong region lock.

- Lately, Error 155 has occurred when a FUU was launched from within android. When encountering a FUU error 155 with the process stalling after the rebootRUU (stuck at black screen with silver HTC logo), please just restart the FUU and leave the phone in that mode, or reboot the phone, then reboot to bootloader, then do “fastboot oem rebootRUU” and then launch the FUU again (thanks [MENTION=2677046]anarchychris[/MENTION] for pointing it out).

- run the fastboot command “fastboot oem lock" - only applies to S-ON phones that want to update the firmware with a stock OTA package (not offered on this thread!!). Stock OTA files sometimes need a locked bootloader.

For “Error 170 Check USB" do:

- Sometimes shown when running a RUU or FUU. Indicates issues with drivers. One way to solve is to run the ARUWizard with the phone already in Fastboot mode. Else you will have to re-install HTC Sync manager. Also, avoid USB 3 ports (the blue ones) - they have a complete new driver stack and that doesn't work well currently.​

NOT safe to reboot / Flash (partly) happened Errors (if you encounter one of them, DON’T reboot):

- 152 Image Error - Phone Screen shows a little triangle beside a full green bar​

For “Error 152 Image Error" do:

- Error 152 is quite rare, have seen it only once with a friend’s phone and it aborted the flash nearly at the end. The flash was started by the FUU. We could resolve the matter by NOT rebooting the phone and flashing the zip again through a manual fastboot flash as outlined further up.​