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

OTA Thread DFU: Merge SDK example with custom application

Hi all!

I'm able to fully test the SDK example https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v3.2.0%2Fthread_example_dfu.html and it works pretty well.

Now, the next step is the integration of this OTA DFU over Thread example in my custom application (that already exploits Thread and MQTT-SN protocol).

I haven't found a tutorial that explains step-by-step this kind of operation. 

Basically I need some help to integrate the DFU client with the user application. I think the key point is the IoT SDK CoAP library that implement a DFU algorithm that should run concurrently to the user application, but I'm a bit confused about merging process.

Thanks in advance,

Alessio

  • EDIT: Finally, with an hardcoded debug session, I found where my code failed

    How can I solve "Signature failed" error?

    I had the attention to use the same public key to compile bootloader and code, and the private key (from which I generated the public key) to create the app_dfu_package.zip

  • UPDATE

    I found that I didn't have this macro on my custom app

    while It is present in the DFU example.

    I added it and now the FW crashes when I start the DFU process.

    The blue mark indicates where the crash happens.

    I think that macro should be in my app, so the problem is that the app crashes.

    Thanks in advance,

    Alessio

  • UPDATE

    I think I found the bug finally.

    My problem is that when the board starts the update, it starts erasing flash memory where there is the Softdevice so It crashes.

    I had a try with a version of my application that doesn't exploit the SD and the DFU starts normally.

    I think something must be changed in the DFU example code to adapt it with a custom application that includes the softdevice.

    I don't wanna update also the SD, but just the application.

    Do you have any ideas which are the required steps? 

    I can attach the debug during the crash

    Seems like there is a problem with 0x000FF000 memory slot, where there is the bootloader_settings_page

    IIs it normal that the DFU application tries to erase settings memory space?

    Moreover I don't know if it is normal this data when I generate the settings with

    $ nrfutil settings generate --family NRF52840 --application SAMBA_Node.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex

    I think i'm using a bootloader compiled without the Softdevice options set...

  • UPDATE

    Also if I use the NOSD version of my application I have the crash.

    The DFU process stucks at 33% 

    and my client starts rebooting continuosly.

    This is the log of the client

    As with the SD version, it tries to erase and write at 0xFF000 where there is the bootloader_setting_page and the FW crashes.

    I think the new data written in 0XFF000 are wrong in some way and then the process can't go ahead.

    Anyone has a tip for this? I'm out of ideas.

Related