Posted 2016-11-11 17:17:47 +0200

blogs->nordicers

# Get started on PC Software for Mesh and Mesh DFU

nRF-connect-Mesh PC tool allows the user to demonstrate the nRF OpenMesh and the Mesh Device Firmware Update (DFU). The Mesh DFU will be used for nRF OpenMesh and the Bluetooth Mesh when it is made available. The nRF OpenMesh used is v0.8.7. The tool will be updated to support the Bluetooth Mesh when it is available.

DFU quick start guide in the nRF OpenMesh repo

## Tools Required

### Hardware

Any one of the below x 2 or more, all of the same type is best during the evaluation

• nRF51-DK
• nRF51-Dongle
• nRF52-DK
• USB Wall Charger or USB battery pack (optional), Used to move the mesh after programming on the PC

## Steps

• Install the nrfjprog as part of thenRF5xcommandlinetoolswin32

• Unzip the attached nRF-connect-mesh zip file

• Connect all the boards that you need for the Mesh demo to the PC.
• Wait until the drivers for the boards have been loaded.
• Run the nRF-Connect executable in the nRF-Connect-Mesh folder

Make sure all boards are identical i.e. nRF51 or nRF52 (do not combine nRF51 and nRF52 in the demo, even though the mesh is capable of handling mixed board sets).

### Demo for the LED lights over Mesh using the nrf-connect-mesh

• Program all the boards with the standard gateway firmware in the "Programming" tab.
• Initialize all the boards in the "Initializing" tab by selecting all boards, click "fill with default values" and selecting the "Initialize selected Devices"
• Click in the Gateway Node tab, select one of the devices as the gateway node
• Handle 0 : control LED 0 on all the boards : "1" will turn it on and "0" will turn it off
• Handle 1 : control LED 1 on all the boards : "1" will turn it on and "0" will turn it off
• Click the "Set" button

You should now be able to control the LED light from the node attached to the PC but setting Handle and value and clicking "set".

### Demo for the DFU using the nrf-connect-mesh

1. Program all the boards with the standard gateway firmware in the "Programming" tab.
2. Initialize all the boards in the "Initializing" tab by selecting all boards, click "fill with default values" and selecting the "Initialize selected Devices"
3. Reset all the boards in the "Initializing" tab by selecting all boards and selecting the "Reset Selected Devices".
4. Select the hex file that you want to flash for nRF51 or nRF52
5. Click on the DFU tab, fill in the text boxes with the suggested values as displayed by default in the text box. Note: The defaults are for nRF51 , If you are using the nRF52 the softdevice id for the nRF52 needs to be modified to match the softdevice used (0x0084)
6. The DFU will be done and the boards will change to the new application after the DFU is complete

If you used the default blinky for nRF51/nRF52 you need to re-program the boards to demo the DFU again.

If you want to test DFU repeatedly by just changing the application version, you need to use the hex files nRF51/examples/ble_gateway/bin which is present in the nRF OpenMesh gitub repo (https://github.com/NordicSemiconductor/nRF51-ble-bcast-mesh)

## Troubleshooting

### Disable Mass storage device in the nRF5x boards

This is typically used when a significant number of boards (more than 4) are attached to the PC. The PC has an anti-virus software that will keep scanning the attached boards seen as USB flash drives and will reduce the stability of the software.

• jlink command used msddisable
• plug out the board
• plug in back in

Segger jlink virtual COM port is used by nRF-connect-mesh and the 5.10n version has been tested with the nRF-connect-mesh. You may need to downgrade to 5.10n if you encounter issues with the DFU

Install the nRF5x-commandline-tools-win32 (this will work for 64bit machines as well) Install segger jlink 5.10n

1. In jlink.exe (also known as jlink commander), (select the correct board if multiple boards are connected), type in the command below exec invalidatefw The update firmware popup will appear click "yes" to allow update.
3. run nrfjprog to attach to the board using the 5.10n dll , any nrfjprog or jlink command that attaches to the debugger should be ok if you are using jlink you need to use the jlink in the 5.10n install at this point so the firmware included with 5.10n will get used. I used nrfjprog --jdll "<C:\Program Files (x86)\SEGGER\JLink_V510n\JLinkARM.dll>" --readcode delete_me.hex ( Remember to change the path to match the path for the 5.10n JLinkARM.dll in your PC)
4. The update firmware popup will appear again (it appears when you do exec invalidatefw as well), click "yes" for the update and you be flashed with the 5.10n version of the firmware

### Reset the boards before attempting DFU

If you encounter issues with the DFU. Select the "Initializing" tab, Select all the connected devices, select "Reset selected devices" the proceed to the DFU tab to do the DFU.

## Known issues

• Blue Screen of Death (BSOD) has been noticed once when tested over a few days.

• The PC became unresponsive once over the few days the tool was tested and needed to be re-booted.

• DFU throws errors even when the DFU has finished successfully Examples : "dfu err: byref() argument must be a ctypes instance, not 'NoneType'" Other non-fatal errors have also been noticed

• When a device is reset using "Initalizing -> select the devices -> Reset Selected Devices" it can take 8 seconds for the reset to complete, so care must be taken to wait for the reset to complete before other operations are started

## References

DFU Quick start Guide

Posted Nov. 12, 2016, 3:43 p.m.

Hi David, Thanks for your writing. I already tested ok for mesh network and DFU with default file. But when I test DFU repeatedly, it cannot success (I used 2 hex files in nRF51/examples/ble_gateway/bin). Do you think I make something wrong here?

Posted Nov. 14, 2016, 9:11 a.m.

Did you bump the application version every time you did the dfu ? Perhaps you can open a question and link it here so I can follow it up.

Posted Nov. 16, 2016, 3:29 a.m.

I already changed App version but it still didn't work. Some error in log field: dfu err: byref() argument must be a ctypes instance, not 'NoneType' dfu err: Timed out waiting for acknowledgement from device.

Posted Nov. 16, 2016, 9:35 a.m.

Can you use the quick start guide to run the steps without the PC gui to narrow the issue. I have added to the known issues that the reset in the initializing screen takes 8 seconds to complete reset, so any commands/DFU done in between is likely to fail.

Posted Nov. 16, 2016, 9:37 a.m.

Can you add a separate question so that we can track this better. Additionally provide the RTT log of the transactions.

Posted Nov. 16, 2016, 5:48 p.m.

Tested again without the GUI and following the quick start guide so that is able to keep upgrading the mesh application via DFU by bumping the version. I see this as a GUI issue.

Posted Dec. 13, 2016, 7:39 a.m.

Hi, I download the zip file, I open it seems nothing happened.Sorry if it stupid question.

And I have a demo connect to the PC. What's wrong?

Posted Dec. 13, 2016, 8:20 a.m.

After install nRF Connect for desktop 1.0.0

It can be open properly,BUT according to the date this blog is the last one, I dont know why.

Posted Dec. 13, 2016, 9:28 a.m.

I am not able to reproduce the issue in the GUI where the screen is blank, however you can run the nrf-connect for mesh as administrator to see if that improves the situation.

Posted Sept. 15, 2017, 5:15 p.m.

The nrf-connect-mesh zip file is probably corrupted. Can you upload a new attachment?

Posted Sept. 18, 2017, 3:13 p.m.

Verified that the zip file is ok, added the file size in the blog post so you can verify that you actually downloaded the full zip file.

Posted Oct. 11, 2017, 6:01 a.m.

It said the compression method is no supported. I am using 7zip

## Recent blog posts

• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis
• ### Multiple channels in RTT

Posted 2017-09-29 11:51:52 by Krzysztof Zaraska
• ### 6 Things to Know about Bluetooth Beacons

Posted 2017-09-22 08:27:00 by Rose Martin
• ### Creating a Keil project for a Bluetooth Mesh example (Updated for 0.10.0)

Posted 2017-09-19 12:08:11 by Kristian Skordal
• ### Using millis() like in Arduino.

Posted 2017-09-18 11:58:04 by schef

## Recent questions

• ### Connecting with nfc_ble_pair_lib

Posted 2017-10-21 22:28:10 by rdecker
• ### close buffer FIFO Rx uart

Posted 2017-10-21 19:44:52 by phanhust
• ### flash data storage on nRF51822 using mbed online compiler?

Posted 2017-10-21 17:57:07 by Hari Charan
• ### How to adapt code from device_manager.h to peer_manager.h?

Posted 2017-10-21 15:39:18 by B
• ### uart in nrf52840

Posted 2017-10-21 14:53:49 by sriram