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

How to extend mesh light_switch example with DFU

I am using the Mesh-SDK v1.0.0, the device is the nRF52832xxAA on PCA10040-Boards with the Softdevice s132. I am new to the development with BLE, and specially mesh. I have successfully done the DFU example, the application won't work, but the DFU looks like it was ok. Now my qestion:

  1. How could I extend the light_switch example to be DFU-ready? (primary target)
  2. Why is the example binary (app_green_s132.hex), which was a part of the DFU exmaple not working? (The board just stops working after the DFU) Is there any sourcecode for this application? Is inside the app_green.hex a build in DFU-functionality, to upgrade this app to a new version?
  3. Somwhere in the documentation stands, that the DFU functionality from the bootloader will be used for the application, how many space is needed in addition to lets say the light_switch-application to implement the DFU functionality? (I tried to update the DFU example with the examlpe itself, but the firmware looked to be too big, i've got a error message at the start of the download "Abort event. Reason: 0xD").
  4. Is there some documentation about the porting of the DFU functionality inside a mesh-application? Or the usage of the bootloader DFU inside the mesh-pplication code?
  • Hello,

    thanks again for this information.

    Q1: This is the only change I've made. I have no idea why the one won't work.

    Q3: I have to update the booltoader and the soft device, so I took the precompiled bootloader hex-file from the mesh sdk (BLE\nrf5_SDK_for_Mesh_v1.0.1_src\bin\bootloader\gccarmemb\mesh_bootloader_gccarmemb_nrf52832_xxAA.hex) and the softdevice.mesh_bootloader_gccarmemb_nrf52832_xxAA.hexs132_nrf52_5.0.0_softdevice.hex

    and started the nrfutil (v3.4) for generating the update.zip

    nrfutil pkg generate --key-file private.key --hw-version 52 --sd-req 0x9D --bootloader mesh_bootloader_gccarmemb_nrf52832_xxAA.hex --bootloader-version 2 --softdevice s132_nrf52_5.0.0_softdevice.hex update.zip
    

    The Output from the attempt gives me an error:

    Traceback (most recent call last):
      File "nordicsemi\__main__.py", line 961, in <module>
      File "site-packages\click\core.py", line 722, in __call__
      File "site-packages\click\core.py", line 697, in main
      File "site-packages\click\core.py", line 1066, in invoke
      File "site-packages\click\core.py", line 1066, in invoke
      File "site-packages\click\core.py", line 895, in invoke
      File "site-packages\click\core.py", line 535, in invoke
      File "nordicsemi\__main__.py", line 618, in generate
      File "nordicsemi\dfu\package.py", line 330, in generate_package
      File "nordicsemi\dfu\nrfhex.py", line 85, in __init__
      File "nordicsemi\dfu\nrfhex.py", line 80, in __init__
      File "nordicsemi\dfu\nrfhex.py", line 94, in _removeuicr
    MemoryError
    Failed to execute script __main__

    What I'am doing wrong?

    That is the point where I'm not sure how I am going further.

    Here my plan of doing the update, I would like to get an answer if my plan is right:

    1. Start Point: A running Application on a development board with secure booltoader. This is working, I can start a dfu for an application on a android device. This point is fine.

    2. Creating Update package with mesh-bootloader and softdevice (this won't work)

    3. Doing the Update with a android.

    4. Now I will hopefully have a device with a working bootloader and softdevice. How can I bring a mesh-application on it? (I've had done some test with a 2nd development board to flash the a application over the serial connction, this works (not allways) look at the Q1)

    Give me some reliable information about your oppinion if my plan would work please. I spent now a way more time on it than I have estimated based o nthe features which nordic gives on the website.

  • hi rolliG,

    i am doing same thing to test mesh dfu example with mesh sdk v1.0.1

    but i am not able  to generate device page after i added public key in to json file.

    this is my json file look like.

    {
        "bootloader_config": {
            "bootloader_id": 1,
            "bootloader_version": 1,
            "company_id": 89,
            "application_id": 1,
            "application_version": 1,
    		"public_key" : "34fdf55c448c77577f69e2969189d946cabf9aaefdce3cacf64e4dbd4d10781d67ccc090838cc43ea3c3e6f91c0646b538e33656733c98a80a7d1ea65697ec9e"
        }
    }
    

    please let me know where i am getting wrong.

  • Hello nikunj,

    this is a problem, which I have also, but I have taken the debug version of the booltoader, which do not check the signature, so I have postponed this problem. The json you have posted looks just like the one in the documentation. And it won't work. There are some another thingies, which didn't work as promised (the tooling for mesh isn't compatible with the ble sdk, the bootloader have many versions, not all of them work togehter with all tools). My wish were to get maybe more smaler tools instead of one tool far all, so maybe someone with python skills could repair it a little bit easier, and another one, it would be great, if the tools would be released with the sdk releases, this would be make the life much easier.

  • Why is the example binary (app_green_s132.hex), which was a part of the DFU exmaple not working? (The board just stops working after the DFU) Is there any sourcecode for this application? Is inside the app_green.hex a build in DFU-functionality, to upgrade this app to a new version?

    app_green.hex is a led blinking program which will blink led 1. it does not have dfu functionality. i have done the same after the dfu my led 1 started blinking but my other device on mesh did not get dfu packet after i pushed dfu to my first device. 

    the reason is to use app_green.hex to verify that dfu works correctly on not i tried to build dfu.zip package with dfu enabled application but it was taking more time to push update about 1 hour in my case.

  • Hi,

    Do you still have problems with device page/dfu? Could you please create a separate case?

    Ketil

Related