[Moto E Q&A, Help & Troubleshooting] thakkardeep18:
Yesterday, I was using my phone (Moto E XT1022) and suddenly it got turned off automatically..

When I tried Switching it on,it got stuck on boot logo...

Tried resetting cache/data from recovery mode but it gives the following error

Also tried flashing 4.4.4 Kitkat stock firmware but it doesn't let me flash..Error:

C:\androide>mfastboot.exe oem lock begin
...
(bootloader) Device is already locked!

OKAY [ 0.023s]
finished. total time: 0.024s

C:\androide>mfastboot.exe flash partition gpt.bin
target max-sparse-size: 256MB
sending 'partition' (32 KB)...
OKAY [ 0.029s]
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
(bootloader) Flashing primary GPT image...
(bootloader) Failed to write primary GPT.

(bootloader) Failed to program partition table
FAILED (remote failure)
finished. total time: 10.488s

C:\androide>mfastboot.exe flash motoboot motoboot.img
target max-sparse-size: 256MB
sending 'motoboot' (1669 KB)...
OKAY [ 0.119s]
writing 'motoboot'...
(bootloader) flashing tz ...
(bootloader) Failed to erase partition
(bootloader) Failed to flash tz
FAILED (remote failure)
finished. total time: 6.740s

C:\androide>mfastboot.exe flash logo logo.bin
target max-sparse-size: 256MB
sending 'logo' (460 KB)...
OKAY [ 0.075s]
writing 'logo'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition logo
FAILED (remote failure)
finished. total time: 5.085s

C:\androide>mfastboot.exe flash boot boot.img
target max-sparse-size: 256MB
sending 'boot' (10200 KB)...
OKAY [ 0.537s]
writing 'boot'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition boot
FAILED (remote failure)
finished. total time: 6.182s

C:\androide>mfastboot.exe flash recovery recovery.img
target max-sparse-size: 256MB
sending 'recovery' (10280 KB)...
OKAY [ 0.556s]
writing 'recovery'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition recovery
FAILED (remote failure)
finished. total time: 6.208s

C:\androide>mfastboot.exe flash system system.img_sparsechunk.0
target max-sparse-size: 256MB
sending 'system' (254408 KB)...
OKAY [ 11.958s]
writing 'system'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 26.784s

C:\androide>mfastboot.exe flash system system.img_sparsechunk.1
target max-sparse-size: 256MB
sending 'system' (245298 KB)...
OKAY [ 11.531s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 19.975s

C:\androide>mfastboot.exe flash system system.img_sparsechunk.2
target max-sparse-size: 256MB
sending 'system' (193465 KB)...
OKAY [ 9.065s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 26.199s

C:\androide>mfastboot.exe flash modem NON-HLOS.bin
target max-sparse-size: 256MB
sending 'modem' (46132 KB)...
OKAY [ 2.197s]
writing 'modem'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition modem
FAILED (remote failure)
finished. total time: 7.217s

C:\androide>mfastboot.exe erase modemst1
erasing 'modemst1'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 5.017s

C:\androide>mfastboot.exe erase modemst2
erasing 'modemst2'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 5.020s

C:\androide>mfastboot.exe flash fsg fsg.mbn
target max-sparse-size: 256MB
sending 'fsg' (857 KB)...
OKAY [ 0.120s]
writing 'fsg'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition fsg
FAILED (remote failure)
finished. total time: 5.139s

C:\androide>mfastboot.exe erase cache
erasing 'cache'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 5.016s

C:\androide>mfastboot.exe erase userdata
erasing 'userdata'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 5.016s

C:\androide>

Tried unlocking bootloader....

Output:

(bootloader) Failed to erase partition
(bootloader) General Unlock failure!
(bootloader) OEM unlock failure! FAILED
(remote failure) finished.
total time: 10.440s

Please help me..If I need to flash any other stock firmware,please help me with a link with complete steps...

Thanks in Advance