David Edwin gravatar image

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.

image description

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

Software

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

image description

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.

Use jlink.exe that is installed as part of Segger jlink

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

Downgrade all your nRF5x boards to segger jlink firmware version 5.10n

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.
  2. exit jlink commander
  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

Remember not to upgrade the jlink firmware board after a downgrade

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

12 comments

Marknnd gravatar image

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?

David Edwin gravatar image

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.

Marknnd gravatar image

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.

David Edwin gravatar image

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.

David Edwin gravatar image

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.

David Edwin gravatar image

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.

temco_heng gravatar image

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.

1.Jlink command

image description

2.The nrfjprog already Installed.

image description

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

image description

temco_heng gravatar image

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

After install nRF Connect for desktop 1.0.0

image description

image description

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

David Edwin gravatar image

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.

yamanoorsai gravatar image

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

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

David Edwin gravatar image

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.

ajay_127 gravatar image

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

Same here, the file is corrupted after download.

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

Sign in to comment.

User menu

    or sign up

Recent questions

Related posts by tag