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.

Procedure:

Get your hands on an 8Mb USB stick. Try and get a fast one. DOS format it.

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:

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.

I'm using Ubuntu 14.04.1 LTS 64-bit to flash the default yocto build and also your ubilinux. I don't have problem running it. BTW, I don't even need xfstk when using flashall.sh from download page for yocto build (I need to install xfstk, when running flashall.sh from your ubilinux). I got my Edison the day before, so only play one day with it. It come with old firmware so I update the firmware (try both copying to folder, then "reboot ota", and also the flashall.sh script, both work fine). Then I decided I need debian than plain yocto, so tried ubilinux. flashall.sh barked than I need xfstk, that when I start installing xfstk on my 64-bit ubuntu box. Is there any chance your flashall.sh is older than the one on download page? The download page doesn't said anything about version (request), but the file I use was "edison-image-ww36-14.zip"

(I'm back to the plain yocto build right now, since ubilinux not work with bluetooth yet)

Could you elaborate your problem, when you said no luck with 64-bit ubuntu?

If you stay with the Yocto image, you probably never need to run the recovery option with flashall. Because there's a different partitioning scheme with ubilinux, the '-b' option is required, which repartitions the emmc and calls flash-ifwi in the script. This flash-ifwi function uses either phoneflashtool or xfstk-dldr-solo, depending on what's installed. So when I'm running the -b option, I don't have phoneflashtool (and couldn't find it on the net), so I'm left with the option of installing xfstk (i.e. building from source)

xFSTK only seems to build on 32-bit ubuntu, as it explicitly requires linking against a 32-bit version of libusb.a. xFSTK refuses to build on a 64-bit OS for me.

So as long as you stick with Yocto, you don't need to use -b or -recovery option, therefore you don't need xfstk.

The flashall.sh I'm using in the ubilinux build is the same one as from the Yocto 36.14 image.

thanks but it was another issue. I prefer setting the time immediately during bootup. So i set a command for "up-post" in network interfaces. I had a mistake there and this command never returned. So i never got a login prompt - bootup hangs (forever). Solved it by flashing the rootfs again and i had a backup to rsync all my personal changes back.