13        Tool 'Firmware' Page

Firmware update support is included as a page in the BB3-3101 configuration tool. The firmware update is done via MS/TP and can be done without taking the BB3-3101 offline except temporarily to restart when the new firmware is ready to run.

13.1       Firmware Organization

There are two copies of the application firmware - a primary and a backup image. The primary image is the one that is always running when the BB3-3101 is booted up. In the unlikely event that the primary image becomes corrupted, the backup image will replace it.

There are redundant copies of something known as a "boot information record" or "boot info" for short. There are two copies of the boot info for the primary image, and two copies of the boot info for the backup image. The primary and backup images are stored in the processor's flash memory. The boot info records are stored in on-chip EEPROM (non-volatile memory).

The boot info record contains the following information: Application code size, application image checksum, model number and variant, and firmware revision.

Upon bootup, the primary application image will be scanned and its checksum calculated. If this does not match the previously stored boot info record, it will be assumed that the application has somehow gotten corrupted. If the primary image is deemed to be corrupt (checksum does not match), then the backup image is scanned. If the backup image is deemed to be good, then the primary application area will be reprogrammed with a copy of the backup image.

It is generally highly unlikely that the application image flash area will become corrupted because the only time any write operations will be taking place with flash is in reprogramming firmware. If power is lost in the middle of a firmware update, for example, then the flash image will likely be corrupted.

It is probably more likely that the EEPROM that stores the boot info may become corrupted by a loss of power while writing to EEPROM. Writes to EEPROM are somewhat more frequent as certain parts of the gateway's configuration are stored there. In the event both primary and backup images fail the checksum test, then a minimal validity check on the primary application is made. If it seems that there is a reasonable chance that the application may be valid, the boot loader will go ahead and start up the primary application, but with an error indication to alert you to the fact that this has happened.

13.2       Verifying Primary Application Image

If you check "Primary" and "Stored" and then click "Get Boot Info", you will retrieve the boot info record for the primary application image.

If you click "Primary" and "Verified" and then click "Get Boot Info", you will cause the gateway to scan its primary application image and compare it to the stored boot info record. It should always come back as valid, no error, and display the current firmware revision.

13.3       Firmware Update Process

If there is newer firmware and you have good reason to believe a firmware update would resolve some issue you're having, then start by obtaining a copy of the firmware update from Control Solutions support. The update will be in the form of a "hex" file, typically named something like "bb3-3101.hex" and its contents, which will always be printable, will look something like this (abbreviated view):

The BB3-3101 configuration tool can be connected locally to the MS/TP network via a Control Solutions MTX002 USB to MS/TP adapter, or via a BACnet IP to MS/TP router such as the Control Solutions BB3-7301. The ability to connect via an IP router means you can do a firmware update remotely. All firmware update support is accomplished via standard BACnet protocol using the Private Transfer service.

To upload a firmware update, start by clicking on the file open icon. Use the standard Windows file dialog that opens automatically to locate your copy of the .hex file and open it. After loading the file, the information displayed now is taken from the file just loaded. The File checkbox indicates that you are looking at boot info for the loaded code file rather than the connected device.

The upload process will take a couple of minutes. During this time, progress will continue to get posted to the status window. When the upload is complete, the boot info record for the update image is written.

The firmware update is programmed into the backup application area of flash memory in the processor chip. Once the upload is complete, and verified, then all you need to do is restart the gateway to complete the process.

Because the firmware update is programmed into the backup image area, you may upload the firmware update while the gateway continues to function normally on the BACnet network. There is no need to take the gateway offline while uploading new firmware. The gateway will be offline only briefly when you restart the gateway after completing the upload.

Following the upload, you can query the stored boot info record for the update image.

By selecting "Verified", you can cause the gateway to scan the code just uploaded and compare the checksum. You should get "Valid, No error" and this will indicate that the upload was successful and code has been verified.

Next, you will need to restart the gateway. Do this by going to the Device page, entering the reinitialize password (default is "buster"), and click the Reinit Device button. The gateway will now restart, and upon bootup, and upon seeing that a newer image is available, the backup image will be copied into the primary application flash area of memory.

Following the restart, you should see the new firmware version displayed when you select Primary and Stored and then click the Get Boot Info button.

You can check Primary and Verified (and click Get Boot Info) to verify that the primary application did get correctly programmed into the primary flash area.

This verification actually happens automatically every time the gateway starts up. If the result was anything other than "Valid, No error", the backup restore will be attempted automatically if there is a valid backup image (which is also used as the update image), and there will be an error indication (red LED) alerting you to the fact this automatic verification failed. This verification via the configuration tool is redundant, but potentially useful if you are connected remotely and cannot see the LED.

You can now go about whatever business you had in configuring the gateway. You can go back to the Who-Is page and click Get Device Info to verify that the updated firmware version is reported to BACnet.