Windows XP - 7 - 8 - 8.1 (Virutal Box or VMware good too)
Let's start!
Connect the phone to your PC
Open Device Manager
1: Find Qualcomm HS-USB QDLoader 9008 device under Ports (COM & LPT) and note the COMxy port (in my case it is COM3).
If you dont see Qualcomm HS-USB QDLoader 9008 click on the CLICK TO SHOW CONTENT button bellow, otherwise don't and follow the guide.
1: If you see LG Android USB Device under Other devices or LGE AndroidNet USB Serial Port under Ports (COM & LPT), then press VOLUME_UP+VOLUME_DOWN+POWER keys until you see QHSUSB_BULK under Other devices or Qualcomm HS-USB QDLoader 9008 device under Ports (COM & LPT). 1: If you see QHSUSB_BULK under Other devices, then you have to install drivers (mirror). Just click on Next, Next... and Finish. You have to turn off driver signature enforcement if you are using Windows 8 or Windows 8.1 to make the drivers work.
Extract the downloaded images 16GB.rar or 32GB.rar to get the image files
Start BoardDiag
1: Select Nexus5 (MSM8974_HammerHead). 2: Select the Com Port you see in Device manager (in my case it is COM3). 3: Select the 16GB or 32GB folder. 4: Select AP check. 5: Select RESTORE BOOT IMG. 1: Click on START.
If you were successful you should see Boot images download completed.
Your phone should turn on, but it may stuck at Google logo. If it is stucked at Google logo you have to reflash a stock rom. You can use either LG FlashTool or fastboot method. You can also flash custom rom from custom recovery if it didn't get replaced by the stock recovery, otherwise flash custom recovery from fastboot.
Extra fun
Quote:
Originally Posted by bitdomo
OP updated.
I want to make a little comment about this boarddiag tool, and how it works.
Emmc test:
Erase: erase the whole emmc. Even if you select a partition from the dropdown menu, Read only: Only reads random blocks from the emmc. If you check DUMP it will read back the amount of blocks of a the chosen partition given in the partition.txt Write only: writes dummy data to the emmc (55AA hex values and some other other random writes on the actual partition). Read/Write: writes dummy data to the emmc (55AA hex values and some other other random writes on the actual partition) and then verify them by reading it back
SDRAM test:
I think this test the memory. There is a Level option for it. I dont know what is the differance between the two.
PIMC ON:
No idea, but in some LG documentations it is for only APQ8064 chipset.
Restore boot img:
Restores the images.
How it know which partitions have to be restored?
There is a rawprogram0.xml in model\Nexus5 (MSM8974_HammerHead)\boot_partition_info folder.
The partitions declared here will be flashed to the device if you select nothing in the partititon dropdown menu or in the restore boot img dropdown menu
Boarddiag only cares about the "label" value (have to be tha same as in partition.txt) from rawprogram0.xml. The rest info like startblock, files size and file name will be acquired from the partition.txt. Partition.txt is a binary file:
0x00-0x03: start block 0x04-0x07: file size in block numbers ( 1 block = 512 byte) 0x08-0x0F: always zero 0x10-0x2F: partition name (must be the same as the label value in rawprogram0.xml) 0x30-0x4F: file name
and the pattern goes on.
I wrote a little program which converts this binary partition.txt to an actual txt. You can get it from here
Copy the partition.txt to the same folder where the bin2txt and txt2bin exes are. Run bin2txt then it will create a readable_partition.txt file. Edit it with notepad++. The start block is in HEX and the file size is in bytes (must be multiple of 512). Partition entries is the number of partition declared in the partition.txt. If you done with the editing then run txt2bin and it will create a new_partition.txt file.
Windows XP - 7 - 8 - 8.1 (Virutal Box or VMware good too)
Let's start!
Connect the phone to your PC
Open Device Manager
1: Find Qualcomm HS-USB QDLoader 9008 device under Ports (COM & LPT) and note the COMxy port (in my case it is COM3).
If you dont see Qualcomm HS-USB QDLoader 9008 click on the CLICK TO SHOW CONTENT button bellow, otherwise don't and follow the guide.
1: If you see LG Android USB Device under Other devices or LGE AndroidNet USB Serial Port under Ports (COM & LPT), then press VOLUME_UP+VOLUME_DOWN+POWER keys until you see QHSUSB_BULK under Other devices or Qualcomm HS-USB QDLoader 9008 device under Ports (COM & LPT). 1: If you see QHSUSB_BULK under Other devices, then you have to install drivers. Just click on Next, Next... and Finish. You have to turn off driver signature enforcement if you are using Windows 8 or Windows 8.1 to make the drivers work.
Extract the downloaded firmware .zip to get the .tot file
Start BoardDiag
1: Select .tot file. 2: Select a directory where to extract .tot file. 3: Click on Extract. It may hangs on extracting system and cache. Just let it finish. 1: Click OK. 1: Select Nexus5 (MSM8974_HammerHead). 2: Select the Com Port you see in Device manager (in my case it is COM3). 3: Select the directory where you extracted the .tot file. 4: Select AP check. 5: Select RESTORE BOOT IMG. 1: Click on START.
If you were successful you should see Boot images download completed.
Your phone should turn on, but it may stuck at Google logo. If it is stucked at Google logo you have to reflash a stock rom. You can use either LG FlashTool or fastboot method. You can also flash custom rom from custom recovery if it didn't get replaced by the stock recovery, otherwise flash custom recovery from fastboot.
Thanks @jd1639 once again for the GPT partition table of the 32GB variant.
The tool is working. I tested on my nexus 5. I dd zeroed out the sbl1 partition. The phone refused to turn on no matter what I do. I did that what is shown in my first post and now the phone is working again. I also tried to help a guy, but it turned out the emmc of his phone has an I/O error. I used the EMMC TEST option to check the emmc for bad sectors.
I am also summoning @rootSU to let him know what a cool stuff nexus 5 has.
Maybe this could work or be adapted for Nexus 4? I ask for personal curiosity
Inviato dal mio Nexus 4 con Tapatalk 2
It could be if we would have the flash programmer hex for nexus 4. I have some for some LG phone, but I have no idea are they working or they are for which phone. If you have a bricked nexus 4 or you know somebody who has I could try check the remaining flash programmers. Maybe 1 works for nexus 4.