How to setup OTA Server and OTA Client on WSTK+4151 radio boards?

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Ninja Employee</font></font> </a> Lesun on ‎07-05-2017 03:57 AM

Question

 

How to setup OTA Server and OTA Client on WSTK+4151 radio boards?

Answer

Here are some instruction about how to setup an OTA Server and OTA Client by WSTK+4151 radio boards. The intention of this article is to setup an OTA Server and OTA Client quickly. We are using the v5.10 EmberZnet stack to do the test. More information please refer to AN728OTAClientServerSetup.

 

In this testing, OTA Server works in NCP mode, we use WSTK+4151 radio board as NCP, and build the Host by Cygwin in Windows OS. The OTA file is storage at Host side. The OTA Client works in SOC mode, it downloads the OTA file to external SPI flash after detect a newer image in OTA Server.

 

  1. OTA Server: NCP mode

Firstly, download standalone Bootloader: serial-uart-bootloader.s37 and NCP firmware: ncp-uart-rts-cts-use-with-serial-uart-btl-5.10.0.s37 to a WSTK kit.

Then create the Host: Z3GatewayHost as follows:

  • Create a Z3GatewayHost sample, then modify the Z3GatewayHost.isc file.
    1. In “ZCL clusters” tab.
      • In the Cluster List pane on the bottom left, expand the General group. Check the Over-the-Air Bootloading Cluster server checkbox.
    2. In “Pringting and CLI” tab.
      • In the Debug Printing section, check the “Enable Debug Printing” checkbox.
      • Expand the Cluster Debugging group.
      • Check the Compiled-in and Enabled at startup checkboxes for the Over-the-Air Bootloading cluster.
    3. In the “HAL Configuration” tab,
      • Make sure the appropriate chip (EFR32-EZSP) is selected.
      • Under the Platform Configuration section, open the Host drop-down menu and select UNIX Host.
    4. In the “Plugins” tab. Make sure the following OTA plugins are checked.
      • OTA Bootload Cluster Common Code
      • OTA Bootload Cluster Server
      • OTA Bootload Cluster Server Policy
      • OTA Bootload Cluster Storage Common Codes
      • OTA POSIX Filesystem Storage Module
  • Save your configuration (ISC) file.
  • Click Generate.
  • Build the Z3GatewayHost in Cygwin.
    1. cd C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v1.1\app\builder\Z3GatewayHost
    2. make
  • Flash bootloader and NCP firmware to the WSTK kit.
  • Run Z3GatewayHost in Cygwin: ./build/exe/Z3GatewayHost.exe -p com37

 

  1. OTA Client: SOC mode

Secondly, flash the Bootloader: app-bootloader-spiflash.s37 to the WSTK kit. Then create an application as OTA Client.

  • Create a blank project, rename the project as “OTAClient”, modify modify the OTAClient.isc file as follows.
    1. In “ZCL clusters” tab.
      • In the Cluster List pane on the bottom left, expand the General group. Check the Over-the-Air Bootloading Cluster client checkbox.
    2. In “Znet Stack” tab.
      • Select the “ZigBee Device Type” as Router. You can also select other Device Type.
    3. In “Pringting and CLI” tab.
      • In the Debug Printing section, check the “Enable Debug Printing” checkbox.
      • Expand the Cluster Debugging group.
      • Check the Compiled-in and Enabled at startup checkboxes for the Over-the-Air Bootloading cluster.
    4. In the “HAL Configuration” tab,
      • Make sure you select the right architecture.
      • Click the Bootloader drop-down menu and specify Application for EFR32MG1.
    5. In the “Plugins” tab. Make sure the following OTA plugins are checked.
      • OTA Bootload Cluster Client
        1. Unselect the “Set Image Attribute (35x SOC only)”
      • OTA Bootload Cluster Client Policy
        1. Check the Perform EBL Verification (SOC Only) checkbox.
        2. In the Firmware Version text entry box, set the value to 1.
      • OTA Bootload Cluster Common Code
      • OTA Bootload Cluster Storage Common Code
      • OTA Cluster Platform Bootloader
      • OTA Simple Storage EEPROM Driver
        1. Check the “SOC Bootloading Support” checkbox.
        2. Modify the “OTA Storage End Offset” from 204800 to 524288. Make sure it has enough space to storage OTA file.
        3. Unselect the “EEPROM Device Red-modify-write Support”.
      • EEPROM
      • OTA Simple Storage Module
  • Save your configuration (ISC) file.
  • Click Generate.
  • Build the OTAClient in Appbuilder.
  • Flash application bootloader and OTAClient.s37 (First Client Image) to another WSTK+4151 kit.
  • Using the OTAClient.isc file to build the Second Client Image
    1. Modify the Firmware Version in “OTA Bootload Cluster Client Policy” plugin,
      • In the Firmware Version text entry box, set the value to 2.
    2. Click Generate.
    3. Build the OTAClient in Appbuilder.
    4. You can find an OTAClient.ota in your build directory. This is the Second Client Image for OTA.

 

  1. Form network and do OTA Test.
  • Copy the OTAClient.ota to Z3GatewayHost/ota-files/ folder in Cygwin
  • Lunch the Z3GatewayHost: ./build/exe/Z3GatewayHost.exe -p com37

1.png

 

  • Form network and pjoin at Z3GatewayHost side
    1. plugin network-creator start 1
    2. plugin network-creator-security open-network
  • Join the network at OTAClient side
    1. Network join <Channel> <TxPower> <PANID>
    2. After the Client join the network, it will discovery OTA Server and query the New Image for download.

2.png