Use a host processor to update the modem firmware for XBee 3 devices over UART prior to *10

This process explains how to update the modem firmware for XBee 3 Cellular devices with a modem firmware version prior to *10 (11410 and 31010).

Update the modem firmware

  1. Make sure you have the correct version of the modem firmware for your XBee device.

  2. Enter programming (bootloader) mode. Use one of the following methods: AT commands or hardware signaling.

    • AT commands
      1. Send the %P command. The %P command must be sent an argument derived from the SL parameter of the module being updated. The argument is the value of SL added to the value 0xDB8A and then masked by performing a bitwise-AND with 0x3FFF.
        1. Run ATSL to get the address value, which is in hex.
          ATSL
          123456
        2. Add bitwise-AND with 0x3FFF.
          (0xDB8A + 0x123456) & 0x3FFF= 0x0FE0
        3. Send the command AT%PFE0.
          AT%PFE0
      2. The OK string is returned.
      3. After the command is sent, the radio module resets and automatically enters programming mode.
      4. Send the FR command to reboot and enter into bootloader.
    •  Invoke the bootloader with hardware signaling
      1. De-Assert RTS (pin 16).
      2. Assert DTR (pin 9).
      3. Put DIN in a low state (break) (pin 3).
      4. Reset the module (pin 5).
      5. Release the break on DIN (pin 3) The module should now be in bootloader at 38400 baud.
  3. Once the module is in programming (bootloader) mode, configure the local serial port to 38400/8/N/1.
  4. Get the hardware version of the radio module from the bootloader.

    1. Send the V command. The response to that command has the following format:

      XXXXYYYYZZAABBBBCCCCCCCCCCCCCCCC
      • XXXX: The hardware version. See ATHV, little endian.
      • YYYY: The hardware revision. See AT%R, little endian.
      • ZZ: The hardware compatibility number. See AT%C.
      • AA: Unused and should be 0.
      • BBBB: The hardware series. See ATHS, little endian.
      • CCCCCCCCCCCCCCCC: The serial number.
  5. If possible, change the baud rate of the serial port to optimize the firmware update process. Send the X command to the bootloader.

    • The bootloader answers with the maximum supported baud rate (in ASCII) and, just after that, the bootloader changes its baud rate to that value. Change your baud rate to match the max supported rate.
    • If the bootloader does not answer to this command, remain at the current rate.
  6. Send the I command (initialization command). This command erases the current firmware from the device.

  7. Transfer the firmware to the device using the transfer protocol shown below.

Transfer the firmware to the device

  1. You must split the file into 512 byte blocks.

  2. Transfer each block using the following structure, with block index and CRC16 sent in little endian byte:

    P [2 bytes for block index] [block data with page size length] [2 bytes for CRC16]

    Note CRC16 is calculated only with the bytes of the page to be sent, and is initialized with 0x0000. The polynomial used for the CRC16 is 0x8005.

  3. After each block is transfered, wait for a response. Options are:

    • 0x55 - ACK: This is the expected answer.

    • 0x12: Checksum/CRC16 error.

    • 0x13: Flash write/verify error.

    Note If an error occurs, you may try to transfer each block up to three times.

  4. Verify and write the firmware to flash.

    1. Send the C command (verify) to verify and write the firmware to the flash.
    2. Verify that the answer to this command is 0x55 (ACK). Any other result is an error.
  5. Wait a couple of seconds for the firmware to be installed and start running.