I thought I'd open a discussion on flashing Edison using the flashall script available as part of the downloadable image for Edison.
I'm not talking about the OTA upgrade, I'm just talking about the flashall method, which can be used to recover a bricked device, to change partition sizes, or, indeed, to put on different Operating Systems such as ubilinux (Debian).
What I've found so far:
- flashall.sh does NOT work on a mac, the script explicitly exludes macs, and it says it only works on linux and windows.
- I have yet to get it working on a Windows machine, when running flashall.bat, there are USB devices coming up and down, and the script just continues regardless without actually doing any flashing, I suspect my driver setup on windows is not right.
- The only platform I've had success with was Linux. Specifically 32-bit versions of Ubuntu. No luck on 64-bit, and I haven't tried any other OS. Anyway, Ubuntu 14.04 32-bit works great.
I'm not saying this is the only way, but it's the way that works for me.
However, there are a few gocha's in getting Linux working. If you want to do a recovery option with the flashall script, it uses a tool called xfdtk-downloader-solo, which is part of the xFSTK package from sourceforge.net. It's not installable via apt-get, etc, you usually need to build for source.
The fllashall script also uses dfu-util, but that's easily obtainable, as you can use apt-get to install it.
So, for those folks that don't have a Linux machine lying around, I thought I might make it a little easier by suggesting the creation of USB live-boot of a suitable Ubuntu, and attach a pre-compiled version of xFSTK to this post so people don't have to compile xFSTK from source. The rest can be done on the live-boot it'self.
- Get your hands on an 8Mb USB stick. Try and get a fast one. DOS format it.
- Download Ubuntu 14.04 32-bit ISO.
- Download http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/
- Using the universal-usb-installer, create a live-boot USB key. Make sure you give it plenty of persistent storage in step 4 of the dialog, as you'll need that to extract your flash images. I'd recommend 4 Gigs.
- Once that's done, you can copy on the xfst-downloader-xxx.deb (attached) and the Edison image file (downloads section) onto the same live-boot USB stick.
- Now boot a machine using the USB stick. When booting, select the "Try Ubuntu" option. The persistent storage we selected when creating the bootable USB key will allow us to make changes that persist across boots, so we don't have to re-do everything every time we boot.
- Once you're into Ubuntu, have a look at the /proc/partitions, and have a look for what might be your USB key. Mount the relevant partition to /mnt and you should then see your xfstk .deb and your Edison image file. Copy them into your home folder, and unmount /mnt.
- Now you can install the xFSTK tools - "dpkg -i xfstk-downloader-_0.0.0_all.deb"
- The apt-sources need to be tweaked to give us access to the dfu-util package, it's not present in the live-boot image, so open up /etc/apt/sources.list and add the line:
- deb http://archive.ubuntu.com/ubuntu/ trusty universe
- then do a sudo apt-get update
- followed by a sudo apt-get install dfu-util
- Now you have all the tools you need, next to do the flash.
- tar xvfz EdisonIMageFile (whatever it's called, might be Yocto, might be ubilinux)
- cd toFlash
- Run "sudo flashall.sh -b"
- Connect on the Edison via USB, and the flash process should proceed.
- You can have a second USB cable connected into the console USB connector on the Edison and monitor the progress from that size. You can sudo apt-get install minicom, then minicom-D /dev/ttyUSB0 -b 115200 to get at the console.
All going well, you should now be able to completely flash (including recovery option) your Edison.
So the next time you want to flash, you can simply boot up the USB key, get the new image, and flash from there. And Keep that USB key safe for the next time
The .deb file attached is a pre-build package of the unmodified source of version 1.7.2 from sourceforge here. If it's not OK to attach this, let me know and I'll remove it, but think that it's OK.
It's for Ubuntu 14.04 32-bit.