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

Configuring and performing DFU over Mesh

I have a question about how to perform DFU over Mesh.

I'm using nRF52840 device.

Following the steps at the URL below (Configuring and performing DFU over Mesh), I'm trying Mesh DFU which is a combination of Mesh5.0 s140_7.2.0.

 

[URL]

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v4.0.0%2Fmd_doc_libraries_dfu_dfu_quick_start.html

 

But, I could not generate a DFU file on Step 1(Generate a DFU archive with nrfutil).

At that time, I got some errors.

Could you please tell me why I could not generate the DFU file ?

I explain details of the problem at the follows.

 

[the problem]

When I tried to generate a DFU file with "blinky_nrf52840_xxAA_s140_7.2.0.hex"

in the located of "nrf5_SDK_for_Mesh_v5.0.0_src\bin\blinky",

I got the following error:

 

"pc-nrfutil\nordicsemi\intelhex\__init__.py", line 342, in _tobinarray_really raise ValueError("tobinarray: wrong value for size")

ValueError: tobinarray: wrong value for size

 

In order to analyze the above problem,

I tried to perform which is a combination of Mesh4.2,following the steps at the URL.

And then, it worked fine.

So, I compared "blinky_nrf52840_xxAA_s140_7.2.0.hex" with "blinky_nrf52840_xxAA_s140_7.0.1.hex"

that has used as the update application of Mesh 4.2.

The file structure and the mapped address look very different.

I guess that "blinky_nrf52840_xxAA_s140_7.2.0.hex" has some problem.

That's why I could not generate the DFU file.

Please tell me your opinion.

 

Thanks in advance.

  • Hello Hung Bui,

    Thank you for your reply.

    [1]  As for send_init_packet function

    I tried *3 and *5 on my environment.

    But, the situation did not change. I got same errors that I described in this topic.

    [2] As for DFUMesh.zip that you attached

    I executed nrfutil.exe in DFUMesh.zip that you attached,
    but I got the following error.

    C:\Users\Desktop\work_mesh_dfu_20210304\work_20210304>nrfutil.exe --verbose dfu serial -pkg dfu_test.zip -p COM23 -b 115200 -fc --mesh
    Traceback (most recent call last):
      File "C:\Users\Desktop\work_mesh_dfu_20210304\work_20210304\nrfutil-script.py", line 6, in <module>
        from pkg_resources import load_entry_point
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 3251, in <module>
        @_call_aside
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 3235, in _call_aside
        f(*args, **kwargs)
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 3264, in _initialize_master_working_set
        working_set = WorkingSet._build_master()
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 583, in _build_master
        ws.require(__requires__)
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 900, in require
        needed = self.resolve(parse_requirements(requirements))
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 786, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'nrfutil==0.3.0.0' distribution was not found and is required by the application

    Could you please tell me what is wrong?

    Thanks in advance,

    Kunny

  • Hi Kunny, 

    The reason the .exe didn't work on your computer could be that it was built and installed to python using 

    python setup.py install 

    I attached my folder that I used to build, could you try to call the same script ?
    pc-nrfutil-mesh_dfu.zip

    Have you tried to use the other files I provided in the .zip file ? Please try to test that with your nrfutil.exe. You can also send your nrfutil.exe so we can test here.

    I think at this point you may want to try debug the DFU target (nRF52) to see why it doesn't response to the first packet of the image.

    Please check the log inside mesh_evt_handler() in main.c of dfu project and check which p_bank() was used. 

    What you can focus on is to check what's the difference between sending the blinky image and when you send your own image. 


    You then may need to debug the bootloader as well. In this devzone case you can find the SES project file for the bootloader: https://devzone.nordicsemi.com/f/nordic-q-a/51534/stepping-through-nrf-mesh-bootloader-code-in-segger-embedded-studio

Related