I had the same issue yesterday, I reflashed stock via fastboot and it fixed the issue, I couldnt flash/wipe/connect to adb or anything, when I tried to mount it showed internal storage size 0, so I went back to the bootloader and flashed all the stock stuff via fastboot and it did the trick for me.
I can reflash a stock, but it writes nothing. It only shows, that it's writing. I can flash CWM instead TWRP. But after a reboot there will be my old TWRP. I can do "fastboot oem lock" and it show "locked", but after reboot it show "unlocked". All is read-only but no errors when writing.
---------- Post added at 09:17 PM ---------- Previous post was at 09:00 PM ----------
Nexus 5 has Sandisk SDIN8DE4. In datasheet there is "Enhanced Write Protection":
----------------------------------------------------------------------------------------------------------------------------------------
To allow the host to protect data against erase or write, the iNAND supports two levels of write
protect command 10 :
• The entire iNAND (including the Boot Area Partitions, General Purpose Area Partition, and
User/Enhanced User Data Area Partition) may be write-protected by setting the permanent
or temporary write protect bits in the CSD.
• Specific segments of the iNAND may be permanently, power-on or temporarily write
protected. Segment size can be programmed via the EXT_CSD register.
For additional information please refer JESD84-A441 standard.
----------------------------------------------------------------------------------------------------------------------------------------
and "H/W Reset":
----------------------------------------------------------------------------------------------------------------------------------------
Hardware reset may be used by host to reset the device, moving the card to a Pre-idle state and
disabling the power-on period write protect on blocks that was set as power-on write protect before
the reset was asserted. For more information, refer to JESD84-A441 standard.
----------------------------------------------------------------------------------------------------------------------------------------
Maybe, there is a way to turn off write protection of just do a hardware reset (but no to loose bootloader)?
Is anybody here familiar with eMMC, chips and JESD84-A441 standard?