Introduction

This document is to be seen as a quick go through to perform your first Wirepas Over-The-Air Programming (OTAP) operation in a minimal Wirepas 5G Mesh network. For a deep dive into the Wirepas 5G Mesh OTAP, please visit this link.

Please note, that if you are already familiar with OTAP from the Wirepas Mesh in 2.4GHz, you may skip this tutorial. However, please note two major differences: 1 - the generated keys to encrypt the files must be asymmetric, 2 - unlike the Wirepas Mesh in 2.4GHz, the propagation process takes advantage of the data plane, and hence the OTAP has minimum impact on service of your nodes while propagation is in progress.

In this tutorial, you will learn how to update your firmware on your nodes and sink. We will use a method relying on the Wirepas Network Tool Client (WNT Client). If your are not familiar with this tool, you may refer to this document.

Requirements

Your Wirepas 5G Mesh Network

To achieve your first OTAP, you need first to establish a minimal Wirepas 5G Mesh network. To do so, you may want to follow this tutorial, if not already done.

In this tutorial, we make the assumption that:

  • A gateway is connected to a Wirepas Network Tool Backend
  • A sink is connected to the Gateway that runs the latest Dual-MCU application
  • Several nodes running at least version:
    • Modem NR+ Firmware 1.0.0
    • Wirepas 5G Mesh stack v5.6.0.27
    • The Evaluation App for the Wirepas 5G Mesh SDK v1.0.0
  • The generated asymmetric keys, that must not be lost. They have been generated while developing your first Wirepas 5G Mesh application, when installing the Software Development Kit (SDK).

Your new Evaluation App

The OTAP is meant to update a Firmware in a product. In addition to the Wirepas Mesh OTAP that allows to update the Stack and the application, the Wirepas 5G Mesh OTAP allows to update the Nordic Semiconductor Modem NR+ Firmware used to implement the DECT-2020 NR radio layer.

As for the Wirepas Mesh in 2.4Ghz OTAP, the Wirepas 5G Mesh OTAP allows to update either one of the above mentioned component or a mix of them.

As for this tutorial, we will focus on updating solely your application. Either you have some ideas to implement on your own, or we propose to integrate a simple modification in the application and then perform the OTAP.

Modify the App Version: In your file config.mk, change the App Version so that the update will be visible in the WNT Client, as the boot diagnostic data, if activated, contains the Application Firmware version.

Also be aware that it is mandatory to not change the Application Specific Area ID, for already deployed devices, as it is the way to identify the firmware component to update on your products.

Generate the scratchpad

The ScratchPad is a file containing a set of binaries reflecting the Firmware parts to be updated in the MCU. It is automatically generated when compiling the App. While compiling the application, different ScratchPads are generated and located in your build directory. Note that some custom compilation may need to be performed to update the DECT-2020 NR Modem firmware. Details can be found here.

When compiling the evaluation application from the SDK folder, the build directory is located in

${pwd}/build/pcaXXXXX/evaluation_app/

where we assume the ${pwd} returns the Wirepas 5G Mesh SDK full path and where XXXXX needs to be replaced with the Development Kit reference, namely pca10153 for a nrf9161.

As one may notice, multiple files are generated, and we will use the *.otap files. They are meant to be used for different purposes.

image-20240425-161736.png

As shown in the above picture, we have:

  • evaluation_app.otap: solely contains the evaluation app firmware.
  • evaluation_app_wpc_stack.otap: contains the evaluation app and Wirepas 5G Mesh stack
  • wpc_stack.otap: solely contains the Wirepas 5G Mesh stack.

In our case, we will only update the application. Hence, it is not necessary to propagate the Wirepas 5G Mesh stack (nor the current DECT-2020 NR Modem Firmware).

For a deep dive on how to generate a custom scratchpad, you may refer to this document (which access is subject to agreement with Wirepas).

You are set now to execute the OTAP

First checks

In the scope of the tutorial, to avoid any flaws in the OTAP process, we need to ensure that the link quality is correct between all the nodes. This implies checking in the Topology tab, after clicking the SET AUTO UPDATE ON button, and the then the SHOW ORGANIC button of your WNT Client that the link quality is above 80% for each link.

image-20240425-162816.png

Also, Wirepas 5G Mesh OTAP approach uses the normal data plane to propagate the scratchpads. Namely, a fraction of the Wirepas 5G Mesh bandwidth will be consumed by the propagation process of the Wirepas 5G Mesh OTAP. Hence, during the OTAP session, the user should remember that the more the traffic is loaded in the Wirepas 5G Mesh network, the more it may take time to propagate the new firmware to all the nodes.

OTAP with Wirepas Network Tool

In the WNT Client, select first a network on which to perform the OTAP. This can be done by selecting the Network ID in the upper left Status Tile, clicking on the dropdown arrow and then select the network. Please note that if you have only network, this operation is still mandatory.

Then, go to Settings → Node Update page where you can find the OTAP control that is described below.

Running OTAP on Wirepas 5G Mesh Network will not cause any downtime during the propagation phase of the scratchpad since it takes advantage of the normal data plane. For the new firmware to be installed and used, each device may reboot up to two times (in case Modem Firmware is updated, an additional reboot is required), causing a short downtime before new firmware is used.

1 - Check network status

In order to understand the network status and the currently deployed OTAP scratchpad in the network, the query is done to the network to fetch this data from the network. To start this query phase, you can select

“Run Once” or “Start Continuous”.

Fetching this information can take a few minutes. Note that querying continuously (Start continuous) prevents you from doing node configurations while a query is running.

The STATUS part in the Update window shows you the number of sinks and nodes in the network and the percentage (and quantity) of sinks and nodes online.

In the NODES you can see the details of the nodes and sinks in the network, e.g. the Wirepas 5G Mesh firmware version, Application firmware version, and scratchpad details (scratchpad sequence number, CRC, Area IDs, etc.).

The aim of this preparation is to get confirmation that your network is ready to make an OTAP. This phase allow to check if you have many nodes and sinks offline. Further investigation must be done to maximize the number of available nodes and sinks alive in the network before moving to the next phase.

2 - Load the scratchpad file to WNT

You can use either Browse the OTAP-image in your computer/network or directly write the path for the OTAP image and then press Load. The scratchpad gets loaded to WNT client and you will see the details of the loaded scratchpad image under the Scratchpad File section. In this phase nothing is yet loaded to the network.

Now you need to check that the nodes you target with this new scratchpad, the firmware and the application Area ID match the loaded OTAP files firmware and application Area IDs (see next figure).

WNT will analyze the new scratchpad image and then will highlight the nodes which will be updated by comparing the nodes' Area ID with the new scratchpad contained Area ID (please check the time of the latest data from the node in Information Updated -column).

You will see the outcome of this in NODES view WILL BE UPDATED (True=will be updated, False=will not be updated). When everything looks good, pressing Continue will proceed to the Process page.

3 - Loading the new scratchpad to the network

In this phase, the new scratchpad will be propagated to the Wirepas 5G Mesh network.

By default and to make an immediate update, just check the “Automatic update” checkbox, and the steps of firmware propagation and activation will be performed all in once, without user intervention. Note, that after the propagation, the device will reboot to activate the new application.

Make sure to select the OTAP v2 method, and then click on “Start Update”. The propagation of the new scratchpad starts immediately, followed by activation when the node receives the new scratchpad.

At the end of the activation process, the status is queried again from the nodes. This phase is meant to see that all the wanted nodes were updated.

 

Note: In case the “Automatic update” box is unchecked, the “Delay” parameter appears :

This delay allows to postpone the start of the scratchpad activation sequence. This delay can be between 10 minutes and 1 day.

4 - Stop the OTAP

After all the desired nodes are updated, it is crucial to stop the OTAP process. This step will avoid a new node entering the network after sometime to be updated in an uncontrolled manner.

Once the final status is acquired, click on “Disable OTAP” to switch the OTAP action to NO_OTAP. Then, click on “Finish” to close the OTAP process and return to the main update page.

Note: you cannot Finish the process while Activation phase is ongoing. The Finish button is only enabled after the activation time has triggered and nodes are taking the new scratchpad into use.

Sink only OTAP

Update sink(s) only checkbox applies the update to only sinks in this network (=the new scratchpad will be loaded only to the sinks in the network).

Concerning the Sink only OTAP, the process is quite the same. Once the box “Update sink(s) only” is checked Start scratchpad status query and Process immediately will check the scratchpad status and send the new scratchpad to the sinks. At the end, the status is verified one more time.

 

Troubleshooting

WNT Client returns the status of the scratchpad, which gives an indication on weather the operation went smoothly or not. The following table summarize the different status :

Stored Scratchpad status

Interpretation

Success

Bootloader successfully processed the scratchpad contents

No space for data

Decompressed data is too large to be written to Flash

New

Bootloader has not yet processed the scratchpad contents

Invalid header

Invalid scratchpad header length

Invalid CRC

Scratchpad CRC check failed

Invalid file header

Invalid file header

Flash Verify Error

Flash write failure (fatal error, old Flash contents lost)

Flash Driver Error

Internal or External flash driver returned an error

Decompression error

Scratchpad contents could not be decompressed

CMAC AUTH ERROR

Scratchpad contents could not be authenticated. This mean that either the bootloader keys used to build the scratchpad or the app_area_id doesn’t match with those present in the node.

MODEM Firmware Failed

In case the modem update step fails, the processing of the rest of the scratchpad is not continued.

Revision History

Date

Version

Notes

06 May 2024

1.0.0

Initial Version

 

Legal Notice

Use of this document is strictly subject to Wirepas’ Terms of Use and Legal Notice.

Copyright © 2024 Wirepas Oy