restore with nvflash in apx mode?

adfad666

Inactive Recognized Developer
Jul 29, 2011
763
4,301
0
Hello,

I've done something very silly to my Nexus 7. I wanted to manually install a new boot.img via fastboot, but in haste i ran 'fastboot erase bootloader' and now it doesn't boot at all, not even the google logo.

I've read about NVflash but I don't have the partition information or other files to flash something working, though it does seem to detect the device.

Any help will be appreciated. It seems many nvidia devices have various custom tools to recover from apx mode, so hopefully something can be found for the Nexus 7 too.
 

onilink67

Senior Member
Nov 23, 2008
298
48
0
Austin
You need the partitions for the 16gb or the 8gb version? I haven't done APX mode on the Nexus 7 but did on my old streak 7 and can probably pull off the files tomorrow (I have 16gb)
 
  • Like
Reactions: adfad666

adfad666

Inactive Recognized Developer
Jul 29, 2011
763
4,301
0
You need the partitions for the 16gb or the 8gb version? I haven't done APX mode on the Nexus 7 but did on my old streak 7 and can probably pull off the files tomorrow (I have 16gb)
That would be fantastic, I also have the 16 GB version!
 

HellcatDroid

Senior Member
Jul 15, 2011
1,043
753
0
Cologne Area
So, would this mean that even when you completely kill the N7 by corrupting the bootloader, you can STILL recover? :eek:

That would be amazing.... something I'd wish my other Android devices would have, kill the bootloader on there and it's hard bricked, dead.

I'll keep an eye on this thread, this is something I am absolutely interested in as well :)

P.S.:
Is there a way to read / dump the required information from an N7 while it's OK and running?
Like a backup for later recovery.
 

adfad666

Inactive Recognized Developer
Jul 29, 2011
763
4,301
0
If you want to try it on linux, grab the All-in-one package from here.

To get it to boot into APX mode i held all three buttons while plugging it in. To confirm it is in APX mode run lsusb and you'll see something like:
Code:
Bus 003 Device 005:[B] ID 0955:7330 NVidia Corp.[/B]
After that, assuming onilink67 can get the files, we can run something like:
Code:
./nvflash --bct nexus7.bct --setbct --bl bootloader.bin --configfile nexus7.cfg --create --go
And it may restore the bootloader.

hopefully on onilink67 can supply some better info since he already has experience with APX :)

Information taken from slatedroid.com, androidroot.mobi and androidroot.mobi
 
  • Like
Reactions: LilTechPrincess

clago87

Senior Member
May 12, 2011
196
12
0
Subscribed! this is the exact problem i have run into. I cant get into my bootloader and device when connected.to the pc.installs a APX driver.by Nvidia

Sent from my HTC PH39100 using xda premium
 

clago87

Senior Member
May 12, 2011
196
12
0
OP and onilink would the files and partitions frim the 16gb be the same or would i need someone with a working 8gb to pull them for me?

Sent from my HTC PH39100 using xda premium
 

clago87

Senior Member
May 12, 2011
196
12
0
Yea i am unlock and on custom rom but i read somewhere asus doesnt void warranty for that. Since I'm completely bricked they shouldnt be able to see I'm on clean rom. Some wishful thinking but this does sound like something viable if i could get those filea and partitions I would definitely give it a shot before calling it quits

Sent from my HTC PH39100 using xda premium
 
Last edited:

onilink67

Senior Member
Nov 23, 2008
298
48
0
Austin
So last time I used APX mode I had a bct file provided to me. IIRC if tegra 2 didn't like the bct file it would refuse to do anything so for the sake of my nexus I hope Tegra 3 is the same. I'm going to research this a little more and hopefully can get something to you guys soon. FYI these files are normally huge
 
  • Like
Reactions: adfad666

clago87

Senior Member
May 12, 2011
196
12
0
So last time I used APX mode I had a bct file provided to me. IIRC if tegra 2 didn't like the bct file it would refuse to do anything so for the sake of my nexus I hope Tegra 3 is the same. I'm going to research this a little more and hopefully can get something to you guys soon. FYI these files are normally huge
Here is to Tegra 3 being a little more mature than T2 and it works for us. If not I guess I have a year to contact asus and send em my paper weight. Thanks for helping out
 

adfad666

Inactive Recognized Developer
Jul 29, 2011
763
4,301
0
The commands to do the backup should be fairly easy once you're in APX mode, according to this post:
./nvflash --bl bootloader.bin --getbct --bct backup.bct --go
./nvflash -r --getpartitiontable partition.txt

./nvflash -r --read 2 part2.img
./nvflash -r --read 3 part3.img
./nvflash -r --read 4 part4.img
./nvflash -r --read 5 part5.img
./nvflash -r --read 6 part6.img
./nvflash -r --read 7 part7.img
./nvflash -r --read 8 part8.img
./nvflash -r --read 9 part9.img
./nvflash -r --read 10 part10.img
./nvflash -r --read 11 part11.img
./nvflash -r --read 12 part12.img
which will generate the necessary bct file, and partition info, and a backup of all the partitions.

The trouble is the bootloader.bin, I'm not sure where to get that for our device. perhaps we can back it up with adb/fastboot.
 

clago87

Senior Member
May 12, 2011
196
12
0
might be silly but im guessing the bootloader info isnt in the img file nakasi-jro03d-factory-e102ba72 that you can download from one of the many threads correct?
 

HellcatDroid

Senior Member
Jul 15, 2011
1,043
753
0
Cologne Area
normally you want the one from your device since this actually copies partitions some will be different on the 8gb model
I have a (working) 8G model :)


The commands to do the backup should be fairly easy once you're in APX mode, according to this post:

which will generate the necessary bct file, and partition info, and a backup of all the partitions.

The trouble is the bootloader.bin, I'm not sure where to get that for our device. perhaps we can back it up with adb/fastboot.
Amazing, I am going to try that ASAP! :D


might be silly but im guessing the bootloader info isnt in the img file nakasi-jro03d-factory-e102ba72 that you can download from one of the many threads correct?
There is a bootloader.img in that download, I am fairly sure that's the one - not to be confused with the boot.img, which is the kernel AFAIK.


// EDIT
Narf, don't have a proper USB cable with me (at work ATM) so I gotta wait till home in about 9 or 10 hours :-/
nvflash must be used in Linux, right? There is no Windows tool for that?
 
Last edited:

yoyo17

Member
May 5, 2008
5
0
0
I did the same thing... don't know what i was thinking. Was trying to get back to stock rom and now this... *sigh. If you guys manage to find a way would be most appreciated. I'm new to this APX stuff so been randomly trying to backup and restore just the bootloader provided by google. Haven't had any luck. It's either unknown device errors, and i haven't been able to find out the SBK either. Total bummer... I'm assuming that we'll be in the clear after restoring the bootloader?


I have a (working) 8G model :)



Amazing, I am going to try that ASAP! :D



There is a bootloader.img in that download, I am fairly sure that's the one - not to be confused with the boot.img, which is the kernel AFAIK.


// EDIT
Narf, don't have a proper USB cable with me (at work ATM) so I gotta wait till home in about 9 or 10 hours :-/
nvflash must be used in Linux, right? There is no Windows tool for that?
 

HellcatDroid

Senior Member
Jul 15, 2011
1,043
753
0
Cologne Area
Maybe we need a nvflash version that supports the N7 or something.... where did the nvflash that's been linked to above come from?
We could ask nVidia for one.

Then again, I think this nvflash thing work with/for the Tegra CPU, so as long as it's provided with the proper input files it shouldn't be device specific - altough on that linked to page they had to use a custom binary to get things started....
 

adfad666

Inactive Recognized Developer
Jul 29, 2011
763
4,301
0
Use the nvflash from the nvidia driver package, found here:

The ones floating around for various devices don't work, but I was able to get some responses from my device with that one.

Now I've hit another problem: I've been trying various things on my device, and now I can't get it into APX mode. In Windows the device connected sound constantly repeats, so I think I've drained the battery, and plugging it into the charger doesn't seem to charge it :/

Looks like I'll have to send it back...
 

HellcatDroid

Senior Member
Jul 15, 2011
1,043
753
0
Cologne Area
Reading through this it seems there is a great deal of more information / data / files we need before we actually can use nvflash in PAX mode....
In order to get a working (e.g. --create) nvflash, we need a few bits of information as well as some files:
  • Secure Boot Key
  • BCT file (boot device setup, ram configuration and a bit more)
  • ODM data (board-specific bit-field specifying various board settings. *Needs* to be correct
  • flash.cfg (e.g. list of settings and names/identifiers of partitions.
The last thing ("flash.cfg") should be easy, I think it can be extracted / generated from a working device ("./nvflash -r --getpartitiontable partition.txt" should/could be it), but as for the rest....


Use the nvflash from the nvidia driver package, found here:

The ones floating around for various devices don't work, but I was able to get some responses from my device with that one.
Cool, thanks for that link, going to check it.


Now I've hit another problem: I've been trying various things on my device, and now I can't get it into APX mode. In Windows the device connected sound constantly repeats, so I think I've drained the battery, and plugging it into the charger doesn't seem to charge it :/
Yeah, the actual charging is handled by the kernel in LPM (low power mode), and it obviously needs a workgin bootloader to boot the kernel into LPM :-/
 

adfad666

Inactive Recognized Developer
Jul 29, 2011
763
4,301
0
Here's a good description of the BCT/ODM, http://projects.pappkartong.se/a500/

Secure Boot Key - I don't think we need that as our bootloader is not locked / encrypted like other devices, though I could be wrong.

BCT file can be pulled from the device

ODM data can be pulled from the BCT

flash.cfg can be generated with ABX once you have the BCT.