How To Flash Wirepas Application

Status

Date

Doc Version

Applicable

Confidentiality

RELEASED

v1.5

Wirepas Mesh v5.x

PUBLIC

Introduction

In this How-To, you will discover how to flash a Wirepas Mesh application previously built with the Wirepas Mesh SDK on the target device.

What you’ll learn

  • configure the programming tool chain in line with the target device
  • program the target device with an application build with the Wirepas Mesh SDK.

What you’ll need

Hardware

  • A Wirepas compatible board:
    1. Wirepas Mesh supports a number devices from Nordic Semiconductor and Silicon Labs. The complete list of supported chips is available in the Wirepas Mesh release note corresponding to each stack version, as well as on the Wirepas Developer Portal Knowledge Base.
    2. Alternatively any board with a chip compatible with Wirepas Mesh Hardware requirements [2]
    3. Note For the purpose of the How-To an nRF52-DK from Nordic Semiconductors and Thunderboard Sense 2 from Silicon Labs are used
  • A Segger J-Link programmer and a cable that is compatible with your board, for example the Segger J-Link Base programmer and possibly additional cables
    1. Only needed if your board does not contain an on-board Segger J-Link debug probe (“J-Link OB“)
    2. Not required if using nRF52-DK or Thunderboard Sense 2
  • A computer with Windows 10
    1. Note 1: the procedure on a Linux operating system or macOS is not described here although the same tools are available for these platforms.

Software

  • A ready to flash Wirepas Image, please refer to the document “How To Install SDK and Build application” [1] for more details
  • Programming Software Tool suited to the target device:
    1. nRF5x Command Line Tool(>= v10.10) for Nordic Semiconductor’s development kits.
      • Note 1: installation procedure given in the following section
    2. Simplicity Commanderfor Silicon Labs' development kits
      • Note 1: installation procedure given in the following section

Getting started

In this document you will set up the programming environment suited to the target device and the steps required to flash an application built using the Wirepas Mesh SDK.

For the purpose of the How-To the following platforms are used:

To achieve this setup three steps are proposed:

  • Step 1: Prepare the hardware programming environment
  • Step 2: Prepare the software programming environment
  • Step 3: Flash Wirepas application into the target device

Please note that the instructions given here can easily be adapted to other types of boards, including custom-designed ones.

Step 1: Prepare the hardware programming environment

In this section you will see how to connect the target device to your computer so that you can program it.

Both example platforms described here embed an on-board Segger J-Link debug probe. As a consequence, there is no need for an extra programmer device. The development board just needs to be connected to a PC via USB (default board configuration) by a Micro-USB cable.

Should you use a different type of board, just connect a Segger J-Link programmer to your chip using a 9-pin Cortex-M SWD Connector or similar. Please note that the Silicon Labs 10-pin Mini Simplicity Connector is not pin-compatible with the 9-pin Cortex-M SWD Connector, even though the connector type is the same.

Silicon Labs Thunderboard Sense 2

More details on TBSense2 board are available here. This board embeds an EFR32MG12 chipset compatible with Wirepas Mesh. Details of the TBSense2 board and connection to the development machine as shown below. A simple USB connection to the PC is needed for programming.

(source: https://www.silabs.com/documents/public/user-guides/ug309-sltb004a-user-guide.pdf)

nRF52-DK 

More details on nRF52-DK are available here. This board embeds an nRF52832 chipset compatible with Wirepas Mesh.

Product Reference: https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK

Here are more details on how to connect the board to a PC for flashing:

Now that your target device is properly connected to your computer, you can see how to install the tools needed to program it.

Step 2: Prepare the software programming environment

This section gives the programming tools' installation instructions needed for both Nordic Semiconductor and Silicon Labs target devices.

Both tools exposes to the user a command line interface to interact with the target device.

Nordic Semiconductor

  • This first step is to avoid an issue while using the Nordic NRF52DK boards, a small procedure to disable the drag & drop programming feature is needed. This procedure is described in the “Solution” section of the Forum post “nRF52 Nordic devkit not working with Raspberry Pi” [3].

To program a Nordic Semiconductor device, the nRF5x Command Line Tool (>= v10.10) tool is needed.

The steps to install it are:

  • download the installer from this page by selecting the proper platform (win64 for Windows10)
  • run the installer. The following window will be displayed:

  • follow the installation instructions
  • at the end of a successful installation process the below message will be displayed

Once nRF5x Command Line Tool is installed you can check it works by:

  • opening a Windows PowerShell prompt
  • entering the given command
nrfjprog.exe --version

If the installation is successful the prompt’s output should look like this:

Note The command output is subjected to change depending on the nRF5x Command Line Tool version installed.

Now the programming environment is fully set-up for your Nordic Semiconductor devices. You can proceed with the next step to flash your application into the target device.

Silicon Labs

To program a Silicon Labs device, the Simplicity commander tool is required.

The steps to install it are:

  • go to the download page
  • then select and download the installer suited to your computer platform
  • Simplicity Commander does not require an installation. Once downloaded, extract the file. You will have a new file starting with the prefix “Commander_win32_x64“ to also decompress
  • finally keep only the “Simplicity Commander“ folder

Now you can check it works by:

  • opening a Windows PowerShell prompt
  • going into the “Simplicity Commander“ folder with the following command format
cd "<path to where is located Simplicity Commander>\Simplicity Commander"
  • then entering this command
commander.exe --version

If the installation is successful the prompt’s output should look like this:

Note The command output is subjected to change depending on the Simplicity Commander tool version installed.

Now the programming environment is fully set-up for your Silicon Labs devices. You can proceed with the next section to flash your application into the target device.

Step 3: Flash Wirepas application into the target device

This section gives the instructions needed to program the target device with a Wirepas application built using the Wirepas SDK for both Nordic Semiconductor and Silicon Labs target devices.

Note The instructions given assume only one device is connected at a time to your computer.

Nordic Semiconductor devices

To flash your target device:

  • open a Windows shell prompt
  • connect your target device to your computer
  • then enter the following command which will unlock the device and trigger a full flash chip erase:
nrfjprog.exe -f nrf52 --recover && nrfjprog.exe -f nrf52 --eraseall
  • once the target device is unlocked use the given command format to flash your application
nrfjprog.exe -f NRF52 --program <path to your application file>\final_image_<application name>.hex --verify --reset
  • When the above command finishes its execution your target device should successfully be programmed with your Wirepas application

The prompt’s output given below illustrates the full flashing process.

Now your device is successfully programmed. In case of error see the troubleshooting section.

Silicon Labs devices

To flash your target device:

  • open a Windows shell prompt
  • go into the Simplicity Commander folder
  • connect your target device to your computer
  • then enter the following command format which will unlock the device and trigger a full flash chip erase:
.\commander.exe device unlock --device <device name>
  1. where device name is either the full target device part number which is the recommended way by Silicon Labs, (e.g. EFR32MG12P233F256GM48) or a partial one (e.g. EFR32MG12) which is an alternative methods given and supported by Silicon Labs.
  2. for instance if your target device is a thunderboard sense 2 SLTB004A rev. B00 (see section 7.1 in the board user guide to see how get the revision number) then the command to use is
.\commander.exe device unlock --device EFR32MG12P332F1024GL125
  • once the target device is unlocked power it off then back on
  • finally use the given command format to flash your application
.\commander.exe flash <path to your application file>\final_image_<application name>.hex --address 0x0 
  • When the above command finishes its execution your target device should successfully be programmed with your Wirepas application

The prompt’s output given below illustrates the full flashing process for a thunderboard sense 2 SLTB004A rev. B00 target device.

Now your device is successfully programmed. In case of error see the troubleshooting section

Going further

The tutorial showed how to set-up the programming environment and flash an application built with the Wirepas SDK to a single target device connected to a computer from Nordic Semiconductor and Silicon Labs.

The tools installed offer many more options (e.g. to program device when several are connected at the same time to the same computer). Everything is described into the following documents:

Troubleshooting

If errors are reported by either nRF5x Command Line Tool or Simplicity Commander the general advices are:

  • power cycle the target device
  • check the target device is powered on before a programming operation
  • check the debugger interface (debug probe) is properly connected to the target device

If none of the above steps worked create a ticket on the Wirepas developer portal with a screenshot of the error prompt or directly contact the chip vendor support.

References

[1] How To Install SDK and Build application

[2] Wirepas Mesh Hardware requirements

[3] nRF52 Nordic devkit not working with Raspberry Pi 4

Revision History

Date

Version

Notes

v1.0

Initial Version

v1.1

Broken/missing link fix
Document layout alignment with other How-To
 Removed J-Link Flash Lite tool usage by chip vendor provided CLI tools

v1.2

Replaced “Wirepas Mesh“ reference by “Wirepas Massive“

Minimal nRF Command line Tool version required added

v1.3

Updated Nordic device programming command

v1.4

Update screenshots

v1.5

Update Nordic chipsets flashing instructions

Replaced “Wirepas Massive“ reference by “Wirepas Mesh“