tegra30_debrick icon indicating copy to clipboard operation
tegra30_debrick copied to clipboard

Fastboot mode recieves "write error" after flashing factory img.

Open Antoron opened this issue 1 year ago • 14 comments

I had Hard bricked Nexus 7 tilapia-nakasig-32gb Hynix (under processor), ME370TG. With your brilliant instruction i managed to flash bootloader (as i understand, they are the same on tilapia and grouper) and entered fastboot. But at first, 7th step resulted in only hanging for several times. I decided to put nexus aside. After several days i tried to volume+ power buttons again and luckily device entered fastboot! Thank you! ... But how it can be?? But all types of images that i tried to flash - were sending, but recieve "write error". Flashing to boot factory recovery ended negative, flasing to boot twrp recovery was successefull, i even could again tap to my device after 10 years of lying in a box, but twrp showed inner memory=0, despite formating, recovering and etc. If i managed to flash bootloader with nvflash, may by there is a way to flash boot and system.img the same way? I am afraid to flash bootloader again from fastboot, but may be i am wrong?.. Or that method of yours with zeros...?

Antoron avatar Aug 04 '23 00:08 Antoron

i found a factory image for tilapia here: https://dl.google.com/dl/android/aosp/nakasig-jdq39-factory-0798439d.tgz

maybe try running the flash-all.sh in there? it will do bootloader and system.

if it still fails it may be bad emmc.

tofurky avatar Aug 04 '23 00:08 tofurky

Already tried factory flash "all" with the same "write error". If emmc is bad, how did i manage to flash bootloder? Maybe i should repartiton to other format or leave the device on google logo for it to mark bab blocks? Also i've read that on these pads, if reset os from 5.11 , it stops writing, vut may be could be reverted?

Antoron avatar Aug 04 '23 01:08 Antoron

could be bad blocks elsewhere in the media

tofurky avatar Aug 04 '23 01:08 tofurky

you can use nvflash to write to the partitions on the flash. example cmd from the README.md:

sudo ./utils/nvflash_v1.13.87205_miniloader_patched --resume --download LNX ./recovery/recovery-clockwork-6.0.4.8-ouya.img --go

i think the partition's name is APP

tofurky avatar Aug 04 '23 01:08 tofurky

Sorry for misunderstanding, but how would i flash to the partition "APP"?

Antoron avatar Aug 04 '23 01:08 Antoron

maybe this:

sudo ./utils/nvflash_v1.13.87205_miniloader_patched --resume --download APP ./system.img --go

where system.img is the stock image

tofurky avatar Aug 04 '23 01:08 tofurky

sorry, there's a missing step. you'd need to convert system.img from an android sparse image to a raw ext4 filesystem before flashing.

https://github.com/anestisb/android-simg2img

tofurky avatar Aug 04 '23 02:08 tofurky

Thank you, sir! But it appears, as you supposed, a broken emmc... My last thought - maybe sbk - cpuid, blob - bct, coding is not properly working?

Antoron avatar Aug 04 '23 20:08 Antoron

Now I think emmc works if I managed to write bootloader to it, maybe i recieve: "PS C:\Program Files\platform-tools> fastboot flash boot boot.img Sending 'boot' (5186 KB) OKAY [ 0.641s] Writing 'boot' FAILED (remote: '(FileWriteFailed)') fastboot: error: Command failed" because bootloader has no permissions? (signing - not defined yet) but does your bct grouper is interchangable with tilapia? and i didnot understood where "--sync" command should be placed?

Antoron avatar Aug 05 '23 12:08 Antoron

i don't know if the bootloaders for tilapia and grouper are interchangable - i did give a link to the original tilapia fastboot (https://dl.google.com/dl/android/aosp/nakasig-jdq39-factory-0798439d.tgz).

rewriting BCT shouldn't be necessary, which is what --sync does.

tofurky avatar Aug 06 '23 00:08 tofurky

I used wrong flash.cfg - from grouper, but should be using tilapia. This is why only bootloader flashed - it is the only partition, that has the same size. Found one on xda, but the last file to find is bct for tilapia. 4 hours of searching - nothing... sadly.. You wrote that they have differencies, but minimal. In my case they may outcome big enough to mess up hole thing. Thank you a lot for your kind help. Rare people on the web are so helpful.

Antoron avatar Aug 06 '23 00:08 Antoron

the flash.cfg shouldn't actually matter since the partition table on the device is correct. there would be an additional partition for modem firmware or similar on tilapia i believe.

it is mostly just there because nvflash requires it to do anything, even if it's unused.

you should be able to read the existing one back though, something like ... --resume --getpartitiontable partitions.txt

tofurky avatar Aug 06 '23 00:08 tofurky

Cant write any files to the device, but managed to get with ./utils/nvflash_v1.13.87205 --getpartitiontable out --setbct --configfile flash32g.cfg --bl test.ebt --bct testr.bct --blob test.blob from your dialouge with [El batman posta] on xda [Nov 21, 2020]

PartitionId=2 Name=BCT DeviceId=18 StartSector=0 NumSectors=768 BytesPerSector=4096

PartitionId=3 Name=PT DeviceId=18 StartSector=768 NumSectors=128 BytesPerSector=4096 ... PartitionId=17 Name=GPT DeviceId=18 StartSector=7635840 NumSectors=128 BytesPerSector=4096

You advised him: "this is NOT the same format that nvflash expects when passing --configfile; you will need to do the math and change the format manually. i would suggest using ./utils/flash.cfg as a reference." How it should look like aproximately? Thank you.

Antoron avatar Aug 09 '23 19:08 Antoron

you shouldn't need an updated flash.cfg. the device's partition table is intact AFAICT. when using --download as i mentioned in prior replies, it uses the partition table already on the device. attempting to repartition the device would likely make things worse.

it should look approximately like ./utils/flash.cfg with perhaps the addition of a new partition and some slightly changed sizes as a result. if i were to guess, i'd think that UDA would be resized to account for a radio partition.

tofurky avatar Aug 09 '23 19:08 tofurky