Stuck at Google screen, recovery mode just turns the screen black I have rooted my Nexus 5 and installed CyanogenMod (Android 6) a few months ago.
It has always been running fine, but today while scrolling a web page it froze, so I long-pressed the power button to reboot it.

The phone started rebooting, showing the Google logo and unlocked lockpad, then the CyanogenMod robot head, as usual.

It then rebooted by itself, once again the Google logo and robot head, and got stuck there.

After 5 minutes without visible progress I long-pressed the power button again.

Now it does not go further than the Google logo screen. I tried again rebooting it a few times, it is always stuck at that screen.

Starting in recovery mode just turns the screen black (the screen is active but only showing black pixels).

#&gt; fastboot oem device-info
...
(bootloader)    Device tampered: true
(bootloader)    Device unlocked: true
(bootloader)    off-mode-charge: true
OKAY [  0.003s]

#&gt; fastboot flash recovery twrp-3.0.2-0-hammerhead.img
target reported max download size of 1073741824 bytes
sending 'recovery' (14524 KB)...
OKAY [  0.665s]
writing 'recovery'...
FAILED (remote: flash write failure)
finished. total time: 44.721s

#&gt; fastboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
FAILED (remote: failed to erase partition)

#&gt; fastboot erase cache
target reported max download size of 1073741824 bytes
erasing 'cache'...  [stays like this forever]


Running fastboot boot twrp-3.0.2-0-hammerhead.img starts TWRP, which shows that Data and System are 0MB:



How to fix it?
FAILED (remote: flash write failure)


Indicates your hardware is dead, so replace the main board or the whole device.

It was designed with a built in limited lifetime of maybe 100,000 writes. LG had to cut some corners to make the Nexus 5 so cheap which is maybe why they die a bit sooner than a flagship device of more then 3 times the cost.

You could try heat annealing the memory but you would need some electrical engineering toys to recover from the resulting hard brick (the firmware would be wiped).