The XBee 3 BLU supports firmware over-the-air (FOTA) updates through the Bluetooth interface. Performing an over-the-air firmware update via Bluetooth on the XBee 3 BLU device is a highly convenient feature, particularly for remote or difficult-to-access installations. This capability allows you to update the device’s firmware wirelessly, without the need for physical access or connection to a computer. It enhances maintenance efficiency, reduces downtime, and ensures that devices in the field stay up-to-date with the latest improvements or security patches.

The OTA firmware update process can be done easily using the XBee Mobile app, which streamlines the entire update procedure. However, if you prefer to implement this process yourself or need to integrate it into a custom application, you can continue reading for more detailed instructions on how to perform the OTA update manually.

To perform an over-the-air firmware update on the XBee 3 BLU, you will need:

  • The XBee 3 BLU device to be updated (referred as target from now on) with the Bluetooth interface enabled.

  • A Bluetooth capable device that will perform the over-the-air firmware update connected and authenticated via Bluetooth with the target device.

  • For more information about authenticating with XBee devices via Bluetooth refer to SRP authentication on XBee devices.

There are three phases of the over-the-air update process:

Distribute the new application

The first phase of performing an over-the-air update on a device is transferring the new firmware file to the target node. Load the new firmware image in the target node’s GPM prior to installation. XBee 3 BLUs use a a Gecko Bootloader (.gbl) file for both serial and over-the-air firmware updates. These firmware files are available on the Digi Support website and via XBee Studio.

Send the contents of the .gbl file to the target device using general purpose memory WRITE commands. The contents of the .gbl file should be stored in order in the appropriate GPM memory blocks. The number of bytes that are sent in an individual GPM WRITE frame is flexible and can be catered to the user application.

Erase the entire GPM prior to beginning an upload of an .gbl file.

Example

The following example shows how to divide and address a .gbl file of 55,141 bytes in blocks of 128 bytes:

GPM_BLOCK_NUM GPM_START_INDEX GPM_NUM_BYTES .gbl bytes

0

0

128

0 to 127

0

128

128

128 to 255

0

256

128

256 to 383

 — 

 — 

 — 

 — 

0

128

1

0

128

1

128

128

 — 

 — 

 — 

 — 

 — 

 — 

 — 

 — 

26

1536

128

54784 to 54911

26

1664

128

54912 to 55039

26

1792

101

55040 to 55140

Install the new application

When the entire .gbl file is uploaded to the GPM of the target node, you can issue a FIRMWARE_VERIFY_AND_INSTALL command. Once the target receives the command it verifies the .gbl file loaded in the GPM. If it is valid, then the device installs the new firmware. This installation process can take up to eight seconds. During the installation the device is unresponsive to both serial and Bluetooth communication. To complete the installation, the target module resets. AT parameter settings which have not been written to flash using the WR command will be lost.

Important considerations

Write all parameters with the WR command before performing a firmware update.

Because explicit API Tx frames can be addressed to a local node (accessible via the SPI or UART) or a remote node (accessible over the RF port), the same process can be used to update firmware on a device in either case.

Verify the new application

For an uploaded application to function correctly, every single byte from the .gbl file must be properly transferred to the GPM. To guarantee that this is the case, GPM VERIFY functions exist to ensure that all bytes are properly in place.

The FIRMWARE_VERIFY function reports whether or not the uploaded data is valid. The FIRMWARE_VERIFY_AND_INSTALL command reports if the uploaded data is invalid. If the data is valid, it begins installing the application. No installation takes place on invalid data.