Example: Updating to the Latest Firmware

In this example we will go through the steps required to update our BrainStem module. We will be using a 40pin USBStem module throughout this excersize; however, the other modules work in a similar way.

Make sure your device is connected and has power. Refer to the Getting Started page for additional information.

Checking for connected devices:

This command will check for both USB and TCP/IP devices connected to your machine and network.

$> ./Updater -D

Looking at the output below you can see that two devices were discovered. One USBStem and one EtherStem. In this example we will be using the USBStem information. This information will be handy in the next step as we will need the serial number of our device in order to update it.

Home directory:[/Users/Mitch]

Application parameters:[Updater]
	[Updater]
	[-D]
Updater [Version 0.2 Nov 24 2015 09:34:27] [Copyright (C) 1994-2015, Acroname Inc.]

Discovering Devices [USB]:
    Device    Module   Router  Model               Firmware Version
    3797E6F8  02       02      04 [USBStem     ]   2.1.5

Discovering Devices [TCPIP]:
    Device    Module   Router  Model               Firmware Version
    856C1C03  06       06      05 [EtherStem   ]   2.1.1 [10.128.38.159]

Completed processing: Updater [Version 0.2 Nov 24 2015 09:34:27] [Copyright (C)
1994-2015, Acroname Inc.]

Getting the latest firmware from Acroname’s servers:

Using the serial number for the USBStem above we will construct the following command. The “-G” will pull the most recent firmware from Acroname’s server for the given device serial number (“-d”).

$> ./Updater -G -d 0x3797E6F8
Home directory:[/Users/Mitch]

Application parameters:[Updater]
	[Updater]
	[-G]
	[-d]
	[0x3797E6F8]
Updater [Version 0.2 Nov 25 2015 09:59:24] [Copyright (C) 1994-2015, Acroname Inc.]
Current build for [3797E6F8][aUSBStem] ==> [130702287].
Get build for [3797E6F8][aUSBStem][130702287] ==> 72784 bytes [YmlyZAEBeJzsunk8lN/b].
GetBuild BIRD [/Users/Mitch/.acroname/updater/3797E6F8/130702287.bird] VERIFIED.
Completed processing: Updater [Version 0.2 Nov 25 2015 09:59:24] [Copyright (C)
1994-2015, Acroname Inc.]

Loading the latest firmware:

Now that we have successfully pulled the most up to date firmware we now need to apply it to the device. The following code will apply the most up to date firmware to the given device.

$> ./Updater -U -d 0x3797E6F8
Home directory:[/Users/Mitch]

Application parameters:[Updater]
	[Updater]
	[-U]
	[-d]
	[0x3797E6F8]
Updater [Version 0.2 Nov 25 2015 09:59:24] [Copyright (C) 1994-2015, Acroname Inc.]
Update using firmware file [/Users/Mitch/.acroname/updater/3797E6F8/130702287.bird].
Transferring loader to device
Transferring loader block 0, 8852 bytes
Transferred 1 blocks, 8852 total bytes
Transferring firmware to device [/Users/Mitch/.acroname/updater/3797E6F8/130702287.bird]
Transferring firmware block 0, 8852 bytes
Transferring firmware block 1, 772 bytes
Transferring firmware block 2, 49668 bytes
Transferred 3 blocks, 59292 total bytes
Completed updating firmware on device [3797E6F8]
Completed processing: Updater [Version 0.2 Nov 25 2015 09:59:24] [Copyright (C)
1994-2015, Acroname Inc.]

At this point the firmware has been downloaded to the device, but it hasn’t yet been applied. If we press the reset button you will see the system LED start to flash rapidly, signifying that the update has been applied and is in Factory Reset mode. Lastly we will need to press the reset one more time so that the system will reboot and begin operating normally.

As with most command line programs you are free to stack commands. The above example can be combined into a single command. Even when combined into a single command there are many ways you can construct it. The following are all valid ways to Update to the latest firmware.

$> ./Updater -GUd 0x3797E6F8
OR
$> ./Updater -GU -d 0x3797E6F8
OR
$> ./Updater -G -U -d 0x3797E6F8
OR
$> ./Updater -d 0x3797E6F8 -UG