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

DFU compatibility for a mesh example

Hi,

I am interested to know how to make a mesh node (for example, a light server) compatible to perform a DFU.

I have gone through the DFU page and I noticed that the DFU is done over the Serial port. I understand that the dfu firmware is being replaced with blinky firmware. Correct me if I am wrong.

Now, what changes should I make to the commands inorder to make the light_server example node to be DFU compatible/capable over the air?

Would replacing the application hex file on step 8 to light_server instead of dfu solve it? or should I add any other commands to have light_server firmware first?

Thank you.

Parents Reply
  • Yes, I did try with downgraded Segger version v3.40.

    The command was 

    nrfutil dfu genpkg --application bin/blinky/blinky_nrf52832_xxAA_s132_6.1.0.hex     --company-id 0x00000059     --application-id 1     --application-version 37      --key-file private_key.txt     --sd-req 0x00AF   --mesh dfu_test2.zip

    I was able to push a packet generated using the same command with a different application version the day before but it failed on Friday.!!

Children
  • Hello,

    And you haven't changed the application-version by now? Is it >=37 when you try to send this packet?

    I suggest that you try to write a .bat script that flashes the softdevice, bootloader device_page and your application, creates the packet, and then initiate the DFU procedure. 

  • Hello,

    I have been using scripts and was able to push the dfu packets successfully. But, this what has happened recently:

    I added DFU functionality to the experimental dimming. I flashed them onto dev boards. I was able to push Blinky to it and it works perfectly fine. 

    Now, I had the dimming example with DFU and I pushed the same example by changing its name. The update was completely pushed but at the end, all the LED's turned ON indicating some error upon loading the new firmware.Now, I can't see the node on the Mesh App.

    Does this indicate any error in the firmware? If so, why doesn't it show up when I initially flash the board with same firmware?

    Any idea on what might be wrong?

    Thank you.

  • That sounds like an app_error being caught by the error handler. Monitor the log when you start the FW. What does it say? 

  • Yes, There is a Mesh assert while loading the new firmware!!

    The logs were:

    <t:      15314>, main.c, 1112, Initializing and adding models

    <t:      20203>, app_error_weak.c,  109, Mesh assert at 0x0002F696 (:0)

    After the assert is occurred, I was trying to program the boards with the same firmware without erasing the board using Segger and it was showing the same error!!

    When I erase the board, I can program the firmware successfully. 

    Similar issue persists with all the examples to which I added the DFU capability. I can push the Blinky successfully but not the customized mesh examples :( 

    To add, I used the DFU example/example to which I added DFU capability and pushed light switch server onto the board and it was pushed successfully.

    Good news is that I traced out where the problem is occurring... 

    It is happening in app_flash_init() function... and the exact location is shown in the figure below in the flash_manager.c file:

    The second nrf_mesh_assert() is causing the error when it is checking if the flash area is valid.

    We are storing some information in the flash like enocean data and few others. Is that causing this error? 

  • DeveloperZ said:
    We are storing some information in the flash like enocean data and few others. Is that causing this error? 

     Well. If you try to modify an example to not store this information, and that works, then yes, that is probably causing the error. How (and if you know, where) are you storing the enocean data?

    And since you add this data somewhere, have you modified any defines in sdk_config.h or nrf_mesh_config_app.h to make sure that the rest of the application handles this data properly? (i.e. doesn't try to use that flash area for something else?)

    Best regards,

    Edvin

Related