[Nexus 7 Q&A, Help & Troubleshooting] barrymcsorley:
A month or so ago my Nexus 7 (2012) started rebooting itself after a minute or so of turning on - I think this may have been during OTA upgrade from JWR66Y to new release. I tried to fix this by clearing app data and booting into CWM recovery and deleting cache and dalvik cache but the problem persisted. So I decided to reset the Nexus 7 back to factory image and have tried every means of doing so but every time I keep getting back to my original data and the app crashes and reboot continues. I have never had any issues connecting to the device on USB and ADB so this is not a driver issue. Things I have tried:

* Hard reset on phone from recovery (plus endless deleting of cache and dalvik)

* Hard reset using Wugfresh toolkit (plus near every other tool on there)

* Hard refresh from recovery mode

* Hard refresh using ADB and deleting user data etc.

* Flash recovery from ADB (also using Wugfresh as per above)

* ADB sideload from recovery of factory images, bootloaders and other ROM's

* Lock/unlock/root/unroot - using ADB commands as well as Wugfresh and other toolkits

* Delete data, system, cache

It seems like the Nexus 7 going into read only mode? Erasing /data and everything else in recovery has no effect and also when trying to overwrite the bootloader I get "writing 'bootloader'... FAILED (remote: (InvalidState))" using Wugfresh toolkit as per below. The device is still running JWR66Y.

I'm totally stuck now as to how I get my Nexus 7 back again! I have seen other people having issues with the JWR66Y bootloader (http://xdaforums.com/showthread.php?t=1907796) but have tried all the workarounds and can't seem to find a way to overwrite the bootloader...

*** Trying with ADB manually ***

C:\android-sdk\platform-tools>adb devices

List of devices attached

4df17c816ec76f25 device

C:\android-sdk\platform-tools>adb devices

List of devices attached

015d165c520bf80f device

C:\android-sdk\platform-tools>adb reboot-bootloader

C:\android-sdk\platform-tools>fastboot devices

015d165c520bf80f fastboot

C:\android-sdk\platform-tools>fastboot oem unlock

...

(bootloader) Bootloader is already unlocked

OKAY [ 0.016s]

finished. total time: 0.016s

C:\android-sdk\platform-tools>fastboot erase boot

erasing 'boot'...

OKAY [ 0.016s]

finished. total time: 0.016s

C:\android-sdk\platform-tools>fastboot erase cache

******** Did you mean to fastboot format this partition?

erasing 'cache'...

OKAY [ 0.016s]

finished. total time: 0.016s

C:\android-sdk\platform-tools>fastboot erase recovery

erasing 'recovery'...

OKAY [ 0.016s]

finished. total time: 0.016s

C:\android-sdk\platform-tools>fastboot erase system

******** Did you mean to fastboot format this partition?

erasing 'system'...

OKAY [ 0.016s]

finished. total time: 0.031s

C:\android-sdk\platform-tools>fastboot erase userdata

******** Did you mean to fastboot format this partition?

erasing 'userdata'...

OKAY [ 0.031s]

finished. total time: 0.031s

C:\android-sdk\platform-tools>fastboot flash bootloader bootloader-grouper-4.23.

img

sending 'bootloader' (2100 KB)...

OKAY [ 0.344s]

writing 'bootloader'...

OKAY [ 0.594s]

finished. total time: 0.938s

C:\android-sdk\platform-tools>fastboot reboot-bootloader

rebooting into bootloader...

OKAY [ 0.016s]

finished. total time: 0.016s

C:\android-sdk\platform-tools>fastboot -w update image-nakasi-kot49h.zip

archive does not contain 'boot.sig'

archive does not contain 'recovery.sig'

archive does not contain 'system.sig'

--------------------------------------------

Bootloader Version...: 4.23

Baseband Version.....: N/A

Serial Number........: 015d165c520bf80f

--------------------------------------------

checking product...

OKAY [ 0.031s]

checking version-bootloader...

OKAY [ 0.031s]

sending 'boot' (4992 KB)...

OKAY [ 0.781s]

writing 'boot'...

OKAY [ 0.172s]

sending 'recovery' (5532 KB)...

OKAY [ 0.844s]

writing 'recovery'...

OKAY [ 0.188s]

erasing 'system'...

OKAY [ 0.016s]

sending 'system' (625382 KB)...

OKAY [ 95.203s]

writing 'system'...

OKAY [ 27.500s]

erasing 'userdata'...

OKAY [ 0.031s]

formatting 'userdata' partition...

Creating filesystem with parameters:

Size: 14442037248

Block size: 4096

Blocks per group: 32768

Inodes per group: 8176

Inode size: 256

Journal blocks: 32768

Label:

Blocks: 3525888

Block groups: 108

Reserved block group size: 863

Created filesystem with 11/883008 inodes and 96825/3525888 blocks

sending 'userdata' (137526 KB)...

writing 'userdata'...

OKAY [ 38.453s]

erasing 'cache'...

OKAY [ 0.016s]

formatting 'cache' partition...

Creating filesystem with parameters:

Size: 464519168

Block size: 4096

Blocks per group: 32768

Inodes per group: 7088

Inode size: 256

Journal blocks: 1772

Label:

Blocks: 113408

Block groups: 4

Reserved block group size: 31

Created filesystem with 11/28352 inodes and 3654/113408 blocks

sending 'cache' (9052 KB)...

writing 'cache'...

OKAY [ 2.203s]

rebooting...

finished. total time: 165.625s

*** Now using Wugfresh tool ***

Flash Stock + Unroot...

------------------------------------------------------------------

erasing 'boot'...

OKAY [ 0.016s]

finished. total time: 0.016s

******** Did you mean to fastboot format this partition?

erasing 'cache'...

OKAY [ 0.016s]

finished. total time: 0.016s

erasing 'recovery'...

OKAY [ 0.016s]

finished. total time: 0.016s

******** Did you mean to fastboot format this partition?

erasing 'system'...

OKAY [ 0.031s]

finished. total time: 0.031s

******** Did you mean to fastboot format this partition?

erasing 'userdata'...

OKAY [ 0.031s]

finished. total time: 0.031s

sending 'bootloader' (3911 KB)...

OKAY [ 0.609s]

writing 'bootloader'...

FAILED (remote: (InvalidState))

finished. total time: 0.828s

rebooting into bootloader...

OKAY [ 0.031s]

finished. total time: 0.031s

archive does not contain 'boot.sig'

archive does not contain 'recovery.sig'

archive does not contain 'system.sig'

--------------------------------------------

Bootloader Version...: 4.23

Baseband Version.....: N/A

Serial Number........: 015d165c520bf80f

--------------------------------------------

checking product...

OKAY [ 0.031s]

checking version-bootloader...

OKAY [ 0.031s]

sending 'boot' (4992 KB)...

OKAY [ 0.781s]

writing 'boot'...

OKAY [ 0.172s]

sending 'recovery' (5532 KB)...

OKAY [ 0.844s]

writing 'recovery'...

OKAY [ 0.188s]

erasing 'system'...

OKAY [ 0.016s]

sending 'system' (625382 KB)...

OKAY [ 96.078s]

writing 'system'...

OKAY [ 27.484s]

erasing 'userdata'...

OKAY [ 0.031s]

formatting 'userdata' partition...

Creating filesystem with parameters:

Size: 14442037248

Block size: 4096

Blocks per group: 32768

Inodes per group: 8176

Inode size: 256

Journal blocks: 32768

Label:

Blocks: 3525888

Block groups: 108

Reserved block group size: 863

Created filesystem with 11/883008 inodes and 96825/3525888 blocks

sending 'userdata' (137526 KB)...

writing 'userdata'...

OKAY [148.516s]

erasing 'cache'...

OKAY [ 0.016s]

formatting 'cache' partition...

Creating filesystem with parameters:

Size: 464519168

Block size: 4096

Blocks per group: 32768

Inodes per group: 7088

Inode size: 256

Journal blocks: 1772

Label:

Blocks: 113408

Block groups: 4

Reserved block group size: 31

Created filesystem with 11/28352 inodes and 3654/113408 blocks

sending 'cache' (9052 KB)...

writing 'cache'...

OKAY [ 3.266s]

rebooting...

finished. total time: 1197.719s