• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

How To Guide Restore OnePlus 9 to Stock via Fastboot Commands

Search This thread

toyanucci

Senior Member
May 28, 2010
854
350
OnePlus 9
I’ll give it a shot, yeah it doesn’t do anything. Can’t see a display or anything on the screen.
That happened to me as well when I tried fastboot reboot fastboot. It used to work fine but recently I did it and ended up stuck in edl. Requested a reapir from OnePlus then found that thread and the Indian msm tool got me back up and running thank God as I didn't have a replacement phone to use while I sent this one back.
 

ilikepie___

Member
Apr 25, 2021
19
0
OnePlus 9 Pro
That happened to me as well when I tried fastboot reboot fastboot. It used to work fine but recently I did it and ended up stuck in edl. Requested a reapir from OnePlus then found that thread and the Indian msm tool got me back up and running thank God as I didn't have a replacement phone to use while I sent this one back.
Unfortunately this didn’t work out for me. I’m waiting to receive a shipping label from one plus to see if they can repair the issue, if not, I’ll just wait until the new pixel comes out and go there. It seems that one plus as a company is falling behind. Yes it’s nice to have the SD888, but if this new tensor chip is gonna be good, I’m gonna go with it I believe if the cost is astronomical for the repair.
 

toyanucci

Senior Member
May 28, 2010
854
350
OnePlus 9
Unfortunately this didn’t work out for me. I’m waiting to receive a shipping label from one plus to see if they can repair the issue, if not, I’ll just wait until the new pixel comes out and go there. It seems that one plus as a company is falling behind. Yes it’s nice to have the SD888, but if this new tensor chip is gonna be good, I’m gonna go with it I believe if the cost is astronomical for the repair.
It should be repaired for free I think.
 

toyanucci

Senior Member
May 28, 2010
854
350
OnePlus 9
We’ll see. I did disassemble the phone to the point to reseat the battery so I’m going to assume it’ll cost something. Who knows though.
Oh. I hadn't opened mine. Very sorry to hear about this though but I too almost panicked when mine seems to be completely unresponsive. Thankfully the thread I mentioned helped me to fix mine but either way I'm trading this in and getting the pixel 6 pro as soon as it's available. I'm bored with OnePlus
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    This guide assumes you have the SDK Platform Tools installed and working, along with USB drivers for your device (if needed), and have your full update zip which you've already extracted the payload.bin from, and then dumped the images using payload dumper. If you haven't done any of these things yet, there are plenty of other guides out there on how to do them.

    Steps:

    1. Reboot your device to the bootloader (power off, then hold volume up + power) and connect it to USB.
    2. The following command will wipe your device. I found this to be necessary to recover my OnePlus 9:
    Code:
    fastboot -w
    3. Now flash the following files:
    Code:
    fastboot flash boot boot.img
    fastboot flash cpucp cpucp.img
    fastboot flash dtbo dtbo.img
    fastboot flash modem modem.img
    fastboot flash oplusstanvbk oplusstanvbk.img
    fastboot flash oplus_sec oplus_sec.img
    fastboot flash qweslicstore qweslicstore.img
    fastboot flash shrm shrm.img
    fastboot flash splash splash.img
    fastboot flash vbmeta vbmeta.img
    fastboot flash vbmeta_vendor vbmeta_vendor.img
    fastboot flash vbmeta_system vbmeta_system.img
    fastboot flash vendor_boot vendor_boot.img
    fastboot flash vm-bootsys vm-bootsys.img
    4. Now reboot into userspace fastboot, aka fastbootd. If you don't do this, the remaining files cannot be flashed:
    Code:
    fastboot reboot fastboot
    5. Flash the remaining files:
    Code:
    fastboot flash abl abl.img
    fastboot flash aop aop.img
    fastboot flash bluetooth bluetooth.img
    fastboot flash devcfg devcfg.img
    fastboot flash dsp dsp.img
    fastboot flash featenabler featenabler.img
    fastboot flash hyp hyp.img
    fastboot flash imagefv imagefv.img
    fastboot flash keymaster keymaster.img
    fastboot flash multiimgoem multiimgoem.img
    fastboot flash qupfw qupfw.img
    fastboot flash tz tz.img
    fastboot flash uefisecapp uefisecapp.img
    fastboot flash xbl xbl.img
    fastboot flash xbl_config xbl_config.img
    fastboot flash product product.img
    fastboot flash system system.img
    fastboot flash system_ext system_ext.img
    fastboot flash vendor vendor.img
    fastboot flash odm odm.img
    6. Final reboot:
    Code:
    fastboot reboot
    7. If everything worked your phone should now boot into OxygenOS.

    Note:
    The files will be flashed to your currently active boot slot. If any of them fail to flash, switch to the other slot and start over from the beginning. I wasn't able to flash odm, product, system, system_ext and vendor to slot a, and had to use slot b instead. To check current slot:
    Code:
    fastboot getvar current-slot
    To switch slots:
    Code:
    fastboot --set-active=a
    or
    Code:
    fastboot --set-active=b

    Use this guide at your own risk. I take no responsibility if you brick your device, set it on fire, or otherwise mess it up as a result of any of the above steps. That being said, it worked for me using 11.2.2.2.LE25AA available from the official OnePlus support website.
    2
    If you want, you can do the flashing easily with powershell, rather than running each command one after the other. Here is what I did:

    1. Have fastboot.exe in your path, or in the same folder as all your extracted images. Open powershell and navigate to the folder with your boot images. Connect your phone to USB.
    2. This will wipe your device! Reboot to the bootloader and run:
    Code:
    fastboot -w
    3. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'boot|cpucp|dtbo|modem|oplusstanvbk|oplus_sec|qweslicstore|shrm|splash|vbmeta|vbmeta_vendor|vbmeta_system|vendor_boot|vm-bootsys'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    4. Run:
    Code:
    fastboot reboot fastboot
    5. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'abl|aop|bluetooth|devcfg|dsp|featenabler|hyp|imagefv|keymaster|multiimgoem|qupfw|tz|uefisecapp|xbl|xbl_config|product|system|system_ext|vendor|odm'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    6. Run:
    Code:
    fastboot reboot
    7. Proceed to boot normally.

    The commands in steps 3 and 5 get a list of all files in the current directory with the .img extension, filter them to the correct ones to flash, and then flash them one after another.

    If someone wants, I can probably throw together a script to run the whole process start to finish.

    Edit: script attached. I've (unfortunately) had the opportunity to test it and fix all the bugs. So it works. You will need to have fastboot.exe accessible in your system PATH to run it.
    1
    If you want, you can do the flashing easily with powershell, rather than running each command one after the other. Here is what I did:

    1. Have fastboot.exe in your path, or in the same folder as all your extracted images. Open powershell and navigate to the folder with your boot images. Connect your phone to USB.
    2. Reboot to the bootloader and run:
    Code:
    fastboot -w
    This will wipe your device!
    3. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'boot|cpucp|dtbo|modem|oplusstanvbk|oplus_sec|qweslicstore|shrm|splash|vbmeta|vbmeta_vendor|vbmeta_system|vendor_boot|vm-bootsys'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    4. Run:
    Code:
    fastboot reboot fastboot
    5. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'abl|aop|bluetooth|devcfg|dsp|featenabler|hyp|imagefv|keymaster|multiimgoem|qupfw|tz|uefisecapp|xbl|xbl_config|product|system|system_ext|vendor|odm'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    6. Run:
    Code:
    fastboot reboot bootloader
    7. Proceed to boot normally.

    The commands in steps 3 and 5 get a list of all files in the current directory with the .img extension, filter them to the correct ones to flash, and then flash them one after another.

    If someone wants, I can probably throw together a script to run the whole process start to finish.
    That would be helpful indeed. Would this script run on mac as well?
    1
    @Slikkster2k: I tried your tutorial. At first it did not work...serveral errors occure during copying one file. On the second run I had to change the slot, than it runs through.

    But now I am in a boot loop, during starting the oxygen.

    While wiping I got this message:
    Code:
    fastboot: error: Cannot generate image for userdata

    Which version of the OS did you use?

    I tried to install the actual european rom (11.2.3.3) on my indian device from china ;) but this obviously did not work. Do you have any suggestions for me?
    I used 11.2.2.2.LE25AA as I said in the original post (this is the global variant, which matches my device). I am not sure if this works for cross-flashing, or if it's possible to cross-flash an Indian phone to EU. Have you tried restoring the Indian ROM? Does that work?

    You're getting an actual boot loop? The error I was getting (and the reason I had to restore) was the phone booting to the bootloader or fastbootd (depending on the slot I tried) instead of Oxygen, because it couldn't mount the user partition due to encryption. In fastbootd an error was reported (I forget the exact one) which made me suspect it was a partition mounting issue. At no point was my phone actually boot looping, even during partial/failed flashes.

    I've never encountered the error with fastboot -w, but I only did that on my phone once. From some searching online, it can be caused by an old version of the platform tools, so did you download the latest version?
    1
    @Slikkster2k: First of all, thank you for providing help :)

    In deed, what worked was the indian first version. This i could flash and from there on everything works. Up to OS and than installing the latest european os. Now everything ist fine...

    The error while whiping did not occure while using the indian version...so no clue why...

    But now it works for me, thank you!