This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mesh DFU Problem using NRF52840

I'm using 3 nRF52840 DK borads (provisioner,light_switch_client, DFU). I set DFU (DFU example used) as target board and connected it to PC as serial interface. I have provisioned light_switch_client with provisioner board. I did step 3 to 6 as mentioned in infocenter.nordicsemi.com/index.jsp for only DFU board, after that i used to transfer firmware from this board to light_switch_client board, i get error as failed to establish connection. The DFU board connected in COM15. Can you please help me?

My sdk version is : nrf5_SDK_for_Mesh_v2.1.1_src

steps:
------

1. D:\Nordic\sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfutilmesh keys --gen-key private_key.txt
Generated key at: private_key.txt

2. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfutilmesh keys --show-vk hex private_key.txt
Verification key Qx: 5985dc051f803ec11990fe27139e65b18b935d7e2873a76f66a40f0b2108e45a
Verification key Qy: 088999730ce716d57b50503920da0ab3ee252cabd03dbb611cd0ae405b58a9d1

3. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfutilmesh dfu genpkg --application bin/blinky/blinky_nrf52840_xxAA_s140_6.0.0.hex --company-id 0x00000059 --application-id 1 --application-version 2 --key-file private_key.txt --sd-req 0x00A9 --mesh dfu_test.zip
Key file was given, setting DFU version to 0.8
Zip created at dfu_test.zip

4. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1\tools\dfu>python device_page_generator.py -d nrf52840_xxAA -sd "s140_6.0.0"
Wrote device page for nrf52840_xxAA with the s140_6.0.0 SoftDevice to bin/device_page_nrf52840_xxAA_s140_6.0.0.hex.

5. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfjprog --eraseall
Erasing user available code and UICR flash areas.
Applying system reset.

6. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfjprog --program bin/softdevice/s140_nrf52_6.0.0_softdevice.hex --chiperase
Parsing hex file.
Erasing user available code and UICR flash areas.
Applying system reset.
Checking that the area to write is not protected.
Programming device.

7. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfjprog --program bin/bootloader/armcc/mesh_bootloader_serial_armcc_nrf52840_xxAA.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

8. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfjprog --program examples\dfu\build\dfu_nrf52840_xxAA_s140_6.0.0_Debug\dfu_nrf52840_xxAA_s140_6.0.0.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

9. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfjprog --program tools/dfu/bin/device_page_nrf52840_xxAA_s140_6.0.0.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

10. D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1>nrfutilmesh --verbose dfu serial -pkg dfu_test.zip -p COM15 -b 9600 -fc --mesh
Upgrading target on COM15 with DFU package D:\Nordic\Sdk\nrf5_SDK_for_Mesh_v2.1.1_src_1\dfu_test.zip. Flow control is enabled.
Flushing com-port...
Opened com-port
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 1656
Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.
PC -> target: 0502aabbccdd
PC -> target: 0502aabbccdd
PC -> target: 0502aabbccdd
PC -> target: 0502aabbccdd
PC -> target: 0502aabbccdd


Failed to upgrade target. Error is: Failed to establish connection

I have changed flash_placement.xml memory segment as mentioned in devzone.nordicsemi.com/.../134485. But still it is not working for me

Please help me i'm new to do DFU in mesh

Parents
  • Hi Satheesh, 

    I don't think you need to modify  flash_placement.xml it was related to an old bug that should be solved now. 

    Please try testing without using any key. Just to simplify the testing.

    Please make sure COM15 is the correct comport and in your code NRF_MESH_SERIAL_ENABLE is set to 1. 

    Please print out RTT log from the DFU firmware , and check if mesh_evt_handler() is called for any DFU event. 

  • NRF_MESH_SERIAL_ENABLE is set to 1 and the com port is COM15 which the DFU Firmware runs. I have used without using key i faced same issue. 

    RTT log:

    0>, main.c, 206, ----- Bluetooth Mesh DFU Example -----
    <t: 12543>, serial_handler_prov.c, 267, Generating encryption keypair...
    <t: 17394>, main.c, 224, Initialization complete!
    <t: 22135>, main.c, 245, Enabling serial interface...
    <t: 22138>, mesh_app_utils.c, 65, Device UUID (raw): 81A2E45B8A562749B3CF37CF4FFAA541
    <t: 22141>, mesh_app_utils.c, 70, Device UUID : 5BE4A281-568A-4927-B3CF-37CF4FFAA541
    <t: 22148>, nrf_mesh_dfu.c, 904, ERROR: No CMD handler!
    <t: 22154>, main.c, 253, DFU example started!

    after i do all the steps it goes to BL_EVT_TYPE_TX_RADIO this case in DFU program.

Reply
  • NRF_MESH_SERIAL_ENABLE is set to 1 and the com port is COM15 which the DFU Firmware runs. I have used without using key i faced same issue. 

    RTT log:

    0>, main.c, 206, ----- Bluetooth Mesh DFU Example -----
    <t: 12543>, serial_handler_prov.c, 267, Generating encryption keypair...
    <t: 17394>, main.c, 224, Initialization complete!
    <t: 22135>, main.c, 245, Enabling serial interface...
    <t: 22138>, mesh_app_utils.c, 65, Device UUID (raw): 81A2E45B8A562749B3CF37CF4FFAA541
    <t: 22141>, mesh_app_utils.c, 70, Device UUID : 5BE4A281-568A-4927-B3CF-37CF4FFAA541
    <t: 22148>, nrf_mesh_dfu.c, 904, ERROR: No CMD handler!
    <t: 22154>, main.c, 253, DFU example started!

    after i do all the steps it goes to BL_EVT_TYPE_TX_RADIO this case in DFU program.

Children
  • The "No CMD handler" log telling that there was a problem with the bootloader, it couldn't talk to the bootloader. Please double check if you have flash the bootloader before running the application. And that you see a bootloader in nRFConnect programming application (or nRFGo Studio)

    I would suggest to try testing with a fresh copy of the SDK. 

  • I have used this bootloader mesh_bootloader_serial_armcc_nrf52840_xxAA.hex, I have tried with fresh copy of sdk, i'm facing same issue.

    After DFU started it goes to this case BL_EVT_TYPE_TX_RADIO  : 

    __LOG(LOG_SRC_DFU, LOG_LEVEL_INFO, "\tRADIO TX! SLOT %d, count %d, interval: %s, handle: %x\n",
    p_evt->params.tx.radio.tx_slot,
    p_evt->params.tx.radio.tx_count,
    p_evt->params.tx.radio.interval_type == BL_RADIO_INTERVAL_TYPE_EXPONENTIAL ? "exponential" : "periodic",
    p_evt->params.tx.radio.p_dfu_packet->packet_type
    );

    RTT Log for DFU:

    <t: 1>, main.c, 206, ----- Bluetooth Mesh DFU Example -----
    <t: 12313>, serial_handler_prov.c, 267, Generating encryption keypair...
    <t: 17173>, main.c, 224, Initialization complete!
    <t: 21919>, main.c, 245, Enabling serial interface...
    <t: 21922>, mesh_app_utils.c, 65, Device UUID (raw): 81A2E45B8A562749B3CF37CF4FFAA541
    <t: 21925>, mesh_app_utils.c, 70, Device UUID : 5BE4A281-568A-4927-B3CF-37CF4FFAA541
    <t: 21932>, nrf_mesh_dfu.c, 528, RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFE
    <t: 21941>, main.c, 253, DFU example started!

  • You can find that the "No CMD handler " is gone compare to the last log you sent.

    - Please try to test again without the signing keys.

    - Please send your dfu project 

    - Please make sure UART is working between your computer and the board, you can test using an UART example. 

  • Now i'm getting this RTT Log in DFU:


    <t: 1>, main.c, 206, ----- Bluetooth Mesh DFU Example -----
    <t: 8769>, serial_handler_prov.c, 267, Generating encryption keypair...
    <t: 13630>, main.c, 224, Initialization complete!
    <t: 18379>, main.c, 245, Enabling serial interface...
    <t: 18382>, mesh_app_utils.c, 65, Device UUID (raw): 81A2E45B8A562749B3CF37CF4FFAA541
    <t: 18385>, mesh_app_utils.c, 70, Device UUID : 5BE4A281-568A-4927-B3CF-37CF4FFAA541
    <t: 18392>, nrf_mesh_dfu.c, 528, RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFE
    <t: 18397>, nrf_mesh_dfu.c, 561, SERIAL TX!
    <t: 18403>, main.c, 253, DFU example started!
    <t: 9579686>, nrf_mesh_dfu.c, 390, New firmware!
    <t: 9579690>, nrf_mesh_dfu.c, 528, RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFD
    <t: 9579693>, nrf_mesh_dfu.c, 534, Killing a TX slot prematurely (repeats done: 30).
    <t: 9579697>, nrf_mesh_dfu.c, 561, SERIAL TX!
    <t: 9645902>, nrf_mesh_dfu.c, 528, RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFD
    <t: 9645906>, nrf_mesh_dfu.c, 534, Killing a TX slot prematurely (repeats done: 0).
    <t: 9645910>, nrf_mesh_dfu.c, 561, SERIAL TX!
    <t: 9711942>, nrf_mesh_dfu.c, 430, DFU start
    <t: 9711945>, nrf_mesh_dfu.c, 528, RADIO TX! SLOT 1, count 6, interval: exponential, handle: FFFC
    <t: 9791823>, nrf_mesh_dfu.c, 329, Erase complete (0x43000)
    <t: 9791827>, nrf_mesh_dfu.c, 333, Flash idle.

  • Looks better. Please provide the screenshot of the nrfutil tool on PC. 

    You may need to follow this link to fix some bug on the nrfutil if you see the same problem (if testing with the blinky image, it should work)

    https://devzone.nordicsemi.com/f/nordic-q-a/46950/problem-with-mesh-dfu

Related