Recovering from a corrupted partition on Intel Edison


I was trying to install MQTT on my Intel Edison board today for a new project and I was trying to follow the steps in the tutorial and during the upgrade I had to convert the partition so I end up deleting the partition and recreate it as a FAT 32 one. I tried then to run the upgrade program which failed and rendered the board pretty useless…

I tries flashing it manually but when trying to run the ./flashall.sh was always failing:
$ ./flashall.sh
Using U-Boot target: edison-blankcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board
Flashing IFWI
Download [=========================] 100% 4194304 bytes
Download [=========================] 100% 4194304 bytes
Flashing U-Boot
Download [=========================] 100% 237568 bytes
Flashing U-Boot Environment
Download [=========================] 100% 65536 bytes
Flashing U-Boot Environment Backup
Download [=========================] 100% 65536 bytes
Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
Timed out while waiting for dfu device 8087:0a99
DEBUG: lsusb
./flashall.sh: line 74: lsusb: command not found
DEBUG: dfu-util -l
dfu-util 0.9


Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:821b] ver=0042, devnum=5, cfg=1, intf=3, path="4-5.3", alt=0, name="UNKNOWN", serial="UNKNOWN"

After wasting lot of time digging around I found an interesting discussion here that got me thinking. While did not answer my question on how to flash it, it helped me to “think creatively” and got it working.

The issue is mainly that  after the reboot, flashily.sh is not able to connect to my board and will timeout throwing an error:

...Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
Timed out while waiting for dfu device 8087:0a99
DEBUG: lsusb
./flashall.sh: line 74: lsusb: command not found
DEBUG: dfu-util -l
fu-util 0.9
...

When reached here, instead of waiting, I unplugged the board from the power, let it start booting then sent a CTRL+C command to interrupt the boot sequence and get in “boot>” prompt. There, just type “run do_flash” over the second port set as a serial console:
boot> run do_flash

After that, the flashily.sh found the board and proceed with the update:

$ ./flashall.sh
Using U-Boot target: edison-blankcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board
Flashing IFWI
Download [=========================] 100% 4194304 bytes
Download [=========================] 100% 4194304 bytes
Flashing U-Boot
Download [=========================] 100% 237568 bytes
Flashing U-Boot Environment
Download [=========================] 100% 65536 bytes
Flashing U-Boot Environment Backup
Download [=========================] 100% 65536 bytes
Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
Flashing boot partition (kernel)
Download [=========================] 100% 6144000 bytes
Flashing rootfs, (it can take up to 5 minutes... Please be patient)
Download [=========================] 100% 1373149184 bytes
Rebooting
U-boot & Kernel System Flash Success...
Your board needs to reboot to complete the flashing procedure, please do not unplug it for 2 minutes.

Everything is working fine, so I can go ahead and install my MQTT.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s