-
Notifications
You must be signed in to change notification settings - Fork 15
Sparrow OTA
Sparrow defines a way to do over-the-air reprogramming of devices. The basic principle is that each device split its flash into two separate images and that the currently running image is used to flash the other image. The upload of a new image use the Array TLV's described in the Encap and TLV page on the wiki.
In the Sparrow repository there is also a set of tools needed for creating OTA images and to upload these images.
To create an image for a device do the following:
>make images TARGET=felicia BOARD=iot-u10
....
>make upload DST=fd00::1234:1234:1234:1234
....
The newly built image will be uploaded to the device with that specific address (this require you to have a border-router running using the prefix fd00::/64).
There is an example application included for testing with Zolertia RE-Mote. To begin with, the RE-Mote needs to be programmed with a rescue image that contains the Sparrow bootloader. The RE-Mote can always be reprogrammed again using the serial bootloader so it is no problems reprogramming the RE-Mote later with another non-Sparrow application.
NOTE: The Sparrow bootloader for CC2538 currently only works when compiled using arm-none-eabi-gcc (Sourcery G++ Lite) 4.3.2. The application on the other hand can be built with any modern ARM compiler. To ease use, a prebuilt bootloader binary is included and used by default when building rescue images for CC2538 based platforms.
>cd examples/zoul/remote
>make IMAGE=1
>make rescue-image
Make sure the RE-Mote is connected via USB
>make upload-rescue-image
Now the RE-Mote should be running an example application where it is possible to control the LEDs and listen to the user button using the Sparrow application layer. Make sure you have a border router running and wait for the RE-Mote to connect to your network before trying to communicate with the node.
Start by creating an image archive for OTA. An image archive contains both images which makes it easy for the upload tool to simply upload the image for the container that is currently not used in the node.
NOTE: Remember to always increase the INC number when recompiling during each day to mark the newly compiled image as newer than the previous image. If both images have the same date and same INC, the first one will be used when booting.
>cd examples/zoul/remote
>make images INC=0
>make upload-fast DST=<IP-address-of-the-RE-Mote-node>
The make rule upload-fast
can be used for faster update of locally
connected (single hop) nodes. The make rule upload
uses a slower
update process that should be used for multihop networks or to avoid
affecting the network during updates.