Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,728,510 Members 55,547 Now Online
XDA Developers Android and Mobile Development Forum

[DEV] USB-BRICK FIX - Restore USB function on your bricked Desire

Tip us?
 
The Professor
Old
(Last edited by The Professor; 4th January 2011 at 11:10 PM.) Reason: Updating links
#1  
Senior Member - OP
Thanks Meter 5
Posts: 271
Join Date: Jan 2008
Location: 's-Hertogenbosch
Talking [DEV] USB-BRICK FIX - Restore USB function on your bricked Desire

Kubino was spot on - the misc overwrite was what caused the issue. If you modify a misc.img to include your CID and flash it back to mtd0, you will restore functionality. I can confirm that USB, BT, FM, recovery all work again on my Desire. The only thing we're not certain about is whether the ROM value in misc.img matters at all, but it doesn't appear to.

Stupid amounts of props go to IEF and adam235 at MoDaCo and kubino here. Thanks to all of you, so much.

MOD EDIT:
below is the post, as this was a combined effort, we don't need to link to modaco.....

As most of you know, people have been hard at work to fix the USB issues we've been seeing due to recovery setting us into USB debugmode.

After unsuccessful attempts to change the kernel commandline , eg. to:

board_bravo.disable_uart3=0
board_bravo.usb_h2w_sw=0

we've been successful in discovering (with the help of XDA-developers) that these switches are stored in the first NAND partition, mtd0, or 'misc'.

You must be rooted to try the following, it seems you can't write to mtd0 without root.
Do step 1 again if you have to.

Also, SD card functionality has to work. For this, do 'fastboot oem enableqxdm 0' in fastboot mode.



Steps involved:

1. Find out your CID. Go into fastboot mode, and do 'fastboot oem boot'.

The log will say something like the following:

CODE
#INFOTAG:Ramdisk OK
#INFOTAG:smi ok, size = 0
#INFOTAG:hwid 0x0
#INFOTAG:skuid 0x21F04
#INFOTAG:hero panel = 0x0
#INFOTAG:engineerid = 0x0
#INFOMCP dual-die
#INFOMCP dual-die
#INFOTAG:mono-die = 0x0
#INFODevice CID is not super CID
#INFOCID is HTC__E11


In this specific case, the CID is HTC__E11.

2. Get the following mtd0.img from the attached files below

Edit this image to the CID you found above with a hex editor.

Optionally, you can use this CID generator by stevebrush instead. Untested by me, but it should work properly.
//Edit: Updated link location for stevebrush. Thanks a ton for the generator!

3. Get flash_image from the attached files below
Move this to /data/ , and flash the modified image using:

"/data/flash_image misc /data/mtd0.img"

You can move both mtd0.img and flash_image by putting it on your sdcard, and issueing the following command in a terminal emulator:

'cat /sdcard/flash_image > /data/flash_image'
'cat /sdcard/mtd0.img > /data/mtd0.img'

You might have to do 'chmod u+x /data/flash_image' before you run the commands (or chmod 755 /data/flash_image)



4. Repeat step 3 a couple of times if it doesn't seem to work well.

5. All done! Reboot, you should have normal usb connectivity. Post your 'fastboot oem boot' log and intermediate steps if it fails.


Credits:

-kubino @ XDA for providing us with the 'misc' information
-TheProfessor @ irc.freenode.net #modaco for being the first test subject + debugging
-adam235 @ irc.freenode.net #modaco for being a test subject as well + debugging
-SgtDavePwnage @ irc.freenode.net #modaco -> moral support + debugging
-DrMon @ irc.freenode.net #modaco -> being brave enough to test on his non-bricked device!
Attached Files
File Type: zip mtd0.zip - [Click for QR Code] (871 Bytes, 7392 views)
File Type: zip flash_image.zip - [Click for QR Code] (49.2 KB, 7590 views)
The Following 4 Users Say Thank You to The Professor For This Useful Post: [ Click to Expand ]
 
PascalMARTIN
Old
#2  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: May 2010
That's great news !
Good work to all !

Now that you know what the problem was, any chance to fix what was causing it in the recovery / flashing / rooting / anything process, to avoid bricking in the future (even if usb-bricking doesn't seem to be much of a problem anymore) ?
 
kubino99
Old
#3  
Senior Member
Thanks Meter 28
Posts: 234
Join Date: Apr 2008
Quote:
Originally Posted by PascalMARTIN View Post
That's great news !
Good work to all !

Now that you know what the problem was, any chance to fix what was causing it in the recovery / flashing / rooting / anything process, to avoid bricking in the future (even if usb-bricking doesn't seem to be much of a problem anymore) ?
at least we've learned how to enter debug mode on Desire
 
The Professor
Old
#4  
Senior Member - OP
Thanks Meter 5
Posts: 271
Join Date: Jan 2008
Location: 's-Hertogenbosch
Next steps are to try and get recovery running from SD. IEF has made a ton of good strides there recently - hopefully we can get that rockin'.
 
shawe_ewahs
Old
(Last edited by shawe_ewahs; 30th May 2010 at 02:54 PM.)
#5  
Senior Member
Thanks Meter 10
Posts: 300
Join Date: Jun 2009
People, if you have a different CID and need to hex edit the file, share here and say also for what CID is edited and for what ROM number.
 
The Professor
Old
#6  
Senior Member - OP
Thanks Meter 5
Posts: 271
Join Date: Jan 2008
Location: 's-Hertogenbosch
I edited mine, since my CID was HTC__E11. Attached if somebody else would like to give it a try. This has ROM version 1.15.405.3 listed in it.
Attached Files
File Type: zip misc.zip - [Click for QR Code] (872 Bytes, 729 views)
 
mardox
Old
#7  
Member
Thanks Meter 0
Posts: 69
Join Date: Feb 2010
does this fix everything? i sent my desire for repar yeserday DOH! i was just wondering if this will fix the super battery drain that happens after a brick?
 
The Professor
Old
#8  
Senior Member - OP
Thanks Meter 5
Posts: 271
Join Date: Jan 2008
Location: 's-Hertogenbosch
Quote:
Originally Posted by mardox View Post
does this fix everything? i sent my desire for repar yeserday DOH! i was just wondering if this will fix the super battery drain that happens after a brick?
This fixes everything. Obviously we can't be 100% sure on battery life yet, but now that we're out of the debug mode, I can't imagine it would continue. I'll report back after a day.
 
martinlong78
Old
#9  
Senior Member
Thanks Meter 0
Posts: 134
Join Date: Aug 2007
This is brilliant chaps! I've backed up my misc fs already ;) Even though I mush have flashed about 10 times without any issue.
 
The Professor
Old
#10  
Senior Member - OP
Thanks Meter 5
Posts: 271
Join Date: Jan 2008
Location: 's-Hertogenbosch
If you've flashed and not run into issues, it might be worth checking out your misc.img in a hex editor anyway just to see what state it's in. It should start with your CID and contain some other strings, including a ROM version. Make sure it's still good.

Tags
usb brick
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes