Using Mfastboot.exe to Flash a Motorola device

Search This thread

Zestypanda

Member
Dec 29, 2011
11
1
I followed the instructions to a T. Now I am met with the red boot light of death. The phone boots, gets past the moto logo, then does the "Drooooiiiidddd" boot sound and has the loading red eye. Then. . .gets stuck. I used a batch file containing the following

mfastboot flash motoboot motoboot.img
mfastboot flash logo logo.bin
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash system system.img_sparsechunk.3
mfastboot flash system system.img_sparsechunk.4
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
mfastboot erase cache
mfastboot erase userdata
pause
Is there anything I should try? I am on Windows 10, so the RSD method does not work for me. I am using the 1080 Verizon version. 16gb. When I originally flashed it gave me an error about gpt.bin.
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,985
2
10,013
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
I followed the instructions to a T. Now I am met with the red boot light of death. The phone boots, gets past the moto logo, then does the "Drooooiiiidddd" boot sound and has the loading red eye. Then. . .gets stuck. I used a batch file containing the following


Is there anything I should try? I am on Windows 10, so the RSD method does not work for me. I am using the 1080 Verizon version. 16gb. When I originally flashed it gave me an error about gpt.bin.
Which firmware version are you flashing?

Sent from my XT1096 using XDA Labs
 

Zestypanda

Member
Dec 29, 2011
11
1
Thank you for the reply. I am using CFC_obake_verizon-user-4.4.4-SU6-7.7-release-keys version I downloaded. I can boot into recovery/stock recovery but it still hangs. I have done wipe cache/system partition. I reflashed the rom, I go into recovery and it boots as if it is going to go to the first time setup wizard then gets stuck on the boot animation.
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,985
2
10,013
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
Thank you for the reply. I am using CFC_obake_verizon-user-4.4.4-SU6-7.7-release-keys version I downloaded. I can boot into recovery/stock recovery but it still hangs. I have done wipe cache/system partition. I reflashed the rom, I go into recovery and it boots as if it is going to go to the first time setup wizard then gets stuck on the boot animation.
Is bootloader locked or unlocked?

Sent from my XT1096 using XDA Labs
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,985
2
10,013
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash system system.img_sparsechunk.3
mfastboot flash system system.img_sparsechunk.4

Sent from my XT1096 using XDA Labs
 

Zestypanda

Member
Dec 29, 2011
11
1
Oh, I was doing that because I was running into this error
(bootloader) Variable not supported!
target reported max download size of 805306368 bytes
Invalid sparse file format at header magi
error: write_sparse_skip_chunk: don't care size 524509064 is not a multiple of the block size 4096
sending sparse 'system' (768973 KB)...
error: write_sparse_skip_chunk: don't care size 524509064 is not a multiple of the block size 4096
OKAY [ 49.390s]
writing 'system'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 49.967s
So I then used the method listed in the moto g thread because I thought that maybe the system.img was too big to be flashed as one single file. So I was flashing it as parts. There is only one system.img but I had it break it up into parts. Is it maybe writing the system image to the wrong part of the flash?
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,985
2
10,013
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
Oh, I was doing that because I was running into this error
So I then used the method listed in the moto g thread because I thought that maybe the system.img was too big to be flashed as one single file. So I was flashing it as parts. There is only one system.img but I had it break it up into parts. Is it maybe writing the system image to the wrong part of the flash?
mfastboot will break it up, but you must use the correct number, looks like there should be 11 sparse chunks
Code:
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash system system.img_sparsechunk.3
mfastboot flash system system.img_sparsechunk.4
mfastboot flash system system.img_sparsechunk.5
mfastboot flash system system.img_sparsechunk.6
mfastboot flash system system.img_sparsechunk.7
mfastboot flash system system.img_sparsechunk.8
mfastboot flash system system.img_sparsechunk.9
mfastboot flash system system.img_sparsechunk.10
 

Zestypanda

Member
Dec 29, 2011
11
1
Thank you for the continued help.

When I run this as my batch file
mfastboot getvar max-sparse-size
mfastboot flash partition gpt.bin
mfastboot flash motoboot motoboot.img
mfastboot flash boot boot.img
mfastboot flash logo logo.bin
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash system system.img_sparsechunk.3
mfastboot flash system system.img_sparsechunk.4
mfastboot flash system system.img_sparsechunk.5
mfastboot flash system system.img_sparsechunk.6
mfastboot flash system system.img_sparsechunk.7
mfastboot flash system system.img_sparsechunk.8
mfastboot flash system system.img_sparsechunk.9
mfastboot flash system system.img_sparsechunk.10
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
mfastboot erase ddr
oem fb_mode_clear
echo press enter to reboot device...
pause
mfastboot reboot
exit


pause

I get this as output

C:\android\mfastboot-v2>mfastboot getvar max-sparse-size
(bootloader) Variable not supported!
getvar:max-sparse-size FAILED (remote failure)
finished. total time: 0.207s

C:\android\mfastboot-v2>mfastboot flash partition gpt.bin
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'partition' (32 KB)...
OKAY [ 0.220s]
writing 'partition'...
(bootloader) This may take a few seconds, if a
(bootloader) different partition table is being
(bootloader) flashed since we need to backup
(bootloader) and restore a few partitions
OKAY [ 0.433s]
finished. total time: 0.657s

C:\android\mfastboot-v2>mfastboot flash motoboot motoboot.img
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'motoboot' (1604 KB)...
OKAY [ 0.349s]
writing 'motoboot'...
(bootloader) flashing tz ...
(bootloader) flashing rpm ...
(bootloader) flashing aboot ...
(bootloader) flashing sbl1 ...
(bootloader) flashing sbl2 ...
(bootloader) flashing sbl3 ...
OKAY [ 4.899s]
finished. total time: 5.250s

C:\android\mfastboot-v2>mfastboot flash boot boot.img
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'boot' (10240 KB)...
OKAY [ 0.906s]
writing 'boot'...
OKAY [ 2.141s]
finished. total time: 3.049s

C:\android\mfastboot-v2>mfastboot flash logo logo.bin
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'logo' (215 KB)...
OKAY [ 0.291s]
writing 'logo'...
OKAY [ 0.901s]
finished. total time: 1.195s

C:\android\mfastboot-v2>mfastboot flash recovery recovery.img
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'recovery' (10240 KB)...
OKAY [ 0.905s]
writing 'recovery'...
OKAY [ 1.731s]
finished. total time: 2.638s

C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.0
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.0': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.1
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.1': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.2
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.2': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.3
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.3': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.4
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.4': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.5
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.5': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.6
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.6': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.7
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.7': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.8
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.8': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.9
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.9': No error


C:\android\mfastboot-v2>mfastboot flash system system.img_sparsechunk.10
(bootloader) Variable not supported!
target max-download-size: 768MB
error: cannot load 'system.img_sparsechunk.10': No error


C:\android\mfastboot-v2>mfastboot flash modem NON-HLOS.bin
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'modem' (54276 KB)...
OKAY [ 3.711s]
writing 'modem'...
OKAY [ 3.388s]
finished. total time: 7.101s

C:\android\mfastboot-v2>mfastboot erase modemst1
erasing 'modemst1'...
OKAY [ 0.486s]
finished. total time: 0.487s

C:\android\mfastboot-v2>mfastboot erase modemst2
erasing 'modemst2'...
OKAY [ 0.466s]
finished. total time: 0.468s

C:\android\mfastboot-v2>mfastboot flash fsg fsg.mbn
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'fsg' (538 KB)...
OKAY [ 0.350s]
writing 'fsg'...
OKAY [ 0.852s]
finished. total time: 1.204s

C:\android\mfastboot-v2>mfastboot erase ddr
erasing 'ddr'...
(bootloader) Invalid partition name ddr
FAILED (remote failure)
finished. total time: 0.103s

C:\android\mfastboot-v2>oem fb_mode_clear
'oem' is not recognized as an internal or external command,
operable program or batch file.

C:\android\mfastboot-v2>echo press enter to reboot device...
press enter to reboot device...

C:\android\mfastboot-v2>pause
Press any key to continue . . .
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,985
2
10,013
South Dakota
goo.gl
Motorola Droid X
Amazon Fire

Zestypanda

Member
Dec 29, 2011
11
1
Ok, I finally got it running.

Here is what I ran

mfastboot getvar max-sparse-size
mfastboot flash partition gpt.bin
mfastboot flash motoboot motoboot.img
mfastboot flash boot boot.img
mfastboot flash logo logo.bin
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash system system.img_sparsechunk.3
mfastboot flash system system.img_sparsechunk.4
mfastboot flash system system.img_sparsechunk.5
mfastboot flash system system.img_sparsechunk.6
mfastboot flash system system.img_sparsechunk.7
mfastboot flash system system.img_sparsechunk.8
mfastboot flash system system.img_sparsechunk.9
mfastboot flash system system.img_sparsechunk.10
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
mfastboot erase ddr
echo press enter to reboot device...
pause
mfastboot reboot
exit


pause
 
  • Like
Reactions: sd_shadow

cooldude1598

Member
Sep 30, 2017
6
0
Cmd showing Waiting for device

My Zip File - XT1624-XT1643_ATHENE_NPJ25.93-11_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
My phone - Moto G4 Plus XT1643 bought with Stock Nougat
Problem - Not booting, light blinking while connect to charger or pc.

cmd is showing <waiting for device>
 
Last edited:

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,985
2
10,013
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
My Zip File - XT1624-XT1643_ATHENE_NPJ25.93-11_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
My phone - Moto G4 Plus XT1643 bought with Stock Nougat
Problem - Not booting, light blinking while connect to charger or pc.

cmd is showing <waiting for device>
If there is no sign of life, don't think you can fix it
 

Arykit

Member
Mar 13, 2015
21
6
Lagos
  • Like
Reactions: sd_shadow

magical ash

Member
Dec 19, 2017
12
1
i think unbricking and flashing are two totally different things.... i think this guide is for flashing the device not for unbrick.....

---------- Post added at 05:45 AM ---------- Previous post was at 05:43 AM ----------

the setup suggested there is a virus cant even run that program....
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Mfastboot
    Although Mfastboot.exe works with most Motorola Devices, the exact files and flash commands may vary, best to see specific forum/threads for the device.
    I haven't updated this thread for a while.
    Mfastboot still works, but the flash commands have changed for newer devices.
    See Guide: Motorola Firmware


    Watch Videos
    Download
    Verify Files
    • Compare File Size with file size form download site
    • Use Hash Checksums
      • mfastboot-v2.zip (1.36 MB) MD5 Sum: 83650a3589d2ecd7c8115ce860d45a23

    Install Moto Drivers
    • Extract files from zip
    • Run Motorola_End_User_Driver_Installation_....msi
    • Reboot PC

    Setup Mfastboot.exe
    • Extract mafastboot.zip to a local drive
    • Example - C:/Mfastboot
    • Open start menu and type CMD
    • Right click on CMD > select open file location
    • Find cmd.exe, right click and copy
    • Paste into Mfastboot folder

    Show known File Types
    • Open C:/Mfastboot folder
    • Select View>options>Change folder and Search options
    • In Folder Options Select Tab View
    • Uncheck Box: Hide Extensions for Known file Types
    • Select OK

    Short Version - Flashing System Only

    • In some cases only System.img is necessary
    • Type commands
      Code:
      mfastboot flash system system.img
      and
    • Type commands
      Code:
      mfastboot reboot
    • Press enter
      if Device does not boot try Long Version

    Long Version -Using Mfastboot to Flash Firmware

    • Note: The exact files needed will very by device model
    • Extract files from Firmware xml.zip
    • Copy
      Code:
      NON-HLOS.bin
      system.img
      boot.img
      recovery.img
      to Mfastboot folder
    • Boot Device to AP Fastboot Mode (Power Off, Hold Volume Down, Press power button for 2-3 secs then release)
    • Note Click here If you see Low Battery, Click here if you see Fastboot Reason: Sticky bit factory_fastboot
    • Run cmd.exe in Mfastboot folder
    • Type commands
      Code:
      mfastboot flash modem NON-HLOS.bin
    • Press enter
    • Type commands
      Code:
      mfastboot erase modemst1
    • Press enter
    • Type commands
      Code:
      mfastboot erase modemst2
    • Press enter
    • Type commands
      Code:
      mfastboot flash system system.img
    • Press enter this may take several minutes to finish and be flashed in several segments.
    • Type commands
      Code:
      mfastboot flash boot boot.img
    • Press enter
    • Type commands
      Code:
      mfastboot flash recovery recovery.img
    • Press enter
    • Type commands
      Code:
      fastboot erase cache
    • Press enter
    • Optional Data Wipe: Type commands
      Code:
      fastboot erase userdata
    • Press enter
    • Type commands
      Code:
      mfastboot reboot
    • Press enter
    • Device should boot normally, If not see RSD Lite or House of Moto
    1
    Troubleshooting

    Q1: Error: Cannot load system.img: Not enough space.
    Solution: try flashing system.img in chunks with
    Code:
    mfastboot flash system system.img -P
    - Thanks to @Merconium for the tip

    Error: UTAG "bootmode" configured as fastboot
    Solution 1:
    Code:
    fastboot oem fb_mode_clear
    fastboot reboot
    Solution 2:
    Code:
    fastboot erase motoboot
    fastboot flash motoboot motoboot.img
    fastboot reboot