Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Antoron opened this issue Aug 4, 2023 · 14 comments
Open

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

Antoron opened this issue Aug 4, 2023 · 14 comments

Comments

@Antoron
Copy link

Antoron commented Aug 4, 2023

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...?

@tofurky
Copy link
Owner

tofurky commented Aug 4, 2023

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.

@Antoron
Copy link
Author

Antoron commented Aug 4, 2023

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?

@tofurky
Copy link
Owner

tofurky commented Aug 4, 2023

could be bad blocks elsewhere in the media

@tofurky
Copy link
Owner

tofurky commented Aug 4, 2023

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

@Antoron
Copy link
Author

Antoron commented Aug 4, 2023

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

@tofurky
Copy link
Owner

tofurky commented Aug 4, 2023

maybe this:

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

where system.img is the stock image

@tofurky
Copy link
Owner

tofurky commented Aug 4, 2023

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

@Antoron
Copy link
Author

Antoron commented Aug 4, 2023

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
Copy link
Author

Antoron commented Aug 5, 2023

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?

@tofurky
Copy link
Owner

tofurky commented Aug 6, 2023

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.

@Antoron
Copy link
Author

Antoron commented Aug 6, 2023

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.

@tofurky
Copy link
Owner

tofurky commented Aug 6, 2023

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

@Antoron
Copy link
Author

Antoron commented Aug 9, 2023

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.

@tofurky
Copy link
Owner

tofurky commented Aug 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants