Easy OS upgrades with SWUpdate

Introduction

As we have shown at ELC2017, we integrated an easy way for warp_0x01 users to upgrade the OS installed in their boards.

Thanks to the nice features provided by SWUpdate and the integration work that we have done in our meta-warpx Yocto layer we are now able to provide straightforward complete OS upgrades in a single file through a simple web interface.

>warpx.io SWUpdate web interface

WARNING: Keep in mind the procedure wipes all the data in the storage of the warp_0x01 and flashes the latest version of the Linux distribution we built using Yocto.

Prerequisites

SWUpdate operates in the following way: a client running on the target (the warp_0x01) obtains an .swu file from the host (your PC) which is then unpacked and interpreted to flash the new OS in the storage (the eMMC).

The installation of the SWUpdate client is done by doing a raw copy of our all-in-one SWUpdate standalone OS image to the warp_0x01 storage using the U-Boot USB Mass Storage feature to export the eMMC as a USB storage. This operation thus requires:

a working U-Boot in the warp_0x01 board with serial console access. If you own an interposer board and haven’t intentionally hacked up U-Boot in your board this requirement is already satisfied

The transfer of the file to the target is done via a web interface exposed by SWUpdate on a fixed IP of an USB Gadget Ethernet interface. To reach the fixed IP of the target, the host computer should support RNDIS USB Ethernet: most Linux distributions include the driver out of the box, while Windows and Mac OS might require manual installation of appropriate driver, depending on the version.

We’ll not enter in the details of using raw copy tools other than dd or how to install RNDIS USB Ethernet drivers, as there are plenty of howtos available on the internet that cover those topics.

SWUpdate client installation

As anticipated, the first step to update the board is to install the SWUpdate client with the SWUpdate standalone OS image we provide. Download the file swupdate-standalone-os.img and follow instructions below.

The SWUpdate standalone OS will now start and be ready in a bunch of seconds.

Firmware update file transfer and deploy

Now that the SWUpdate client is up and running on the warp_0x01 we need to setup the host to connect and reach the webpage to upload the .swu firmware update file.

Setup the RNDIS USB Ethernet interface

As the warp_0x01 USB Ethernet interface is already setup with the fixed IP 192.168.20.10 (netmask 255.255.255.0) all that is needed is to set a fixed IP on the USB Ethernet device on the host on the same network. This is a Linux example to do so:

When the web interface reports “SWUPDATE successful !” in the Status Messages of the web interface the OS is successfully upgraded, and you can boot it just by pressing the “Reboot Device” button!

Whenever you want to upgrade to a newer version, you just need to go back to the “Boot SWUpdate standalone OS image” section and follow the instruction from there on!

Conclusions

We hope that the work we’ve done will help you with the task of keeping your warp_0x01 up-to-date.

We plan to make some improvements in the future to upgrade the installed version of U-Boot too and allow to easily switch from the regular OS to the SWUpdate standalone OS without having to enter commands to the U-Boot prompt. So if you have any feedback or you need a helping hand, please reach out to us in the mailing list!