Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
Firmware Update

Back to Trident IoT SDK

The Z-Wave bootloader supports firmware updates through two modes:

  • Over the Air Update (OTA)
  • Over the Wire Update (OTW)

The firmware image is always compressed using LZMA and digitally signed.

To sign the image, we use OpenSSL to generate a pair of private and public keys. Here are the steps involved:

  1. Generate a private key:
    openssl ecparam -genkey -name prime256v1 -noout -out private_key.pem
  2. Generate a public key from the private key:
    openssl ec -in <private_key_name>.pem --outform DER -pubout -out public_key.der
  3. Creates a JSON file that includes the tokens for the x and y components of the bootloader's public key.
    /tools/public_key_json.py -i public_key.der -o <keys_folder_path>/public_key.json
    The <keys_folder_path> is the path to the folder where the private and pubic keys are stored.

The private and public keys should be stored in the /keys folder.

OTA/OTW

The public key must be flashed to the secure page before flashing any firmware to the chip.
To flash the key stored in the above json file, run the following elcap command:

elcap tokens write --file <keys_folder_path>/public_key.json --target T32CZ20B --usb <jlink_sn>

<jlink_sn> is the J-Link serial number printed on the DKNCZ20 board.

Once the public key has been flashed, you can proceed to FLASH the firmware image.

Performing OTW

The Z-Wave bootloader uses the Xmodem protocol to receive the OTW image.
The bootloader only supports Xmodem-CRC32.
The bootloader default UART is UART0 using a 115200 baud rate with 8 data bits, and 1 stop bit and no parity bit.
The txd and rxd pins are 17, and 16 subsequntly.
The used UART can be changed by implementing the API zpal_otw_hw_config.
To initiate the OTW update process, follow these steps:

  1. The host should send the following SerialAPI command to the target:
    0x01 0x03 0x00 0x27 0xDB
    The target should respond with an ACK:
    0x06
  2. The host must wait for the following sequence from the target:
    0x3E 0x64 0x43
    The host must then respond with:
    0x31
  3. The host must now wait for a response of 0x43 from the target.
  4. Once received, the host can start sending the OTW image to the target using the Xmodem protocol.
  5. After the host has finished sending the OTW image, the target will reboot to begin the update process.
  6. When the target bootloader completes the update process, it will reboot again to jump to the application.