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

  • Hi,

    I'm not aware of any tutorials describing this exact process, but it should basically be a matter of merging the code, add relevant source files/header paths, and required sdk_config.h configurations from one project to the other.

    If you are using MQTT-SN and not CoAP in your main application, it should not cause major issues when merging with the OTA Client. If you had been using CoAP, you would face a bigger task, as the OTA Client usese the IoT CoAP library, while the Thread applications uses the built-in CoAP library in OpenThread. This would require you to port the CoAP applications to the IoT CoAP library, but this is not required with MQTT-SN.

    I would recommend you to start out with merging your applications. If you are facing any issues or problems, please post the issues here and we will help you resolve it.

    Best regards,
    Jørgen

  • Hi Jorgen,

    this is an error that i couldn't handle.


    I saw that for this error I need to insert the file in the flash_management.xml but I checked that the file is already there.

    Thanks in advandce,

    Alessio

    EDIT: ok I think the key was this topic: 

    https://devzone.nordicsemi.com/f/nordic-q-a/49497/bootloader_settings_page-will-not-fit-in-region-unplaced_sections

    But I have a question. In the DFU example the different parts are these ones:

    In my custom application I use the SoftDevice s140, does I need to insert the parts related to MBR? If i get well, those parts are there cause DFU example doesn't use SD but only MBR. Am I missing something?

    I inserted only the bootloader parts in this way:

    but I received back this error related to mbr (even if I didn't insert MBR part in my flash_management.xml)

  • AS_Kalpa said:
    In my custom application I use the SoftDevice s140, does I need to insert the parts related to MBR? If i get well, those parts are there cause DFU example doesn't use SD but only MBR. Am I missing something?

    You need to include all sections, both in the flash_placements.xml file, and in the Memory Segments parameter in the project options.

    The softdevice includes the MBR, so it is present in both applications. MBR settings page is used to allow secure updates of the bootloader, and is required by all DFU examples.

  • Ok thanks I got it. Finally I can build without errors, now I'm gonna test the functionalities, I will be in touch if I find something wrong.

  • I think I need some clarifications about flashing different FW components.

    In order to have the OTA DFU example working, I have to flash:

    • mbr_nrf52_2.4.1_mbr.hex (MBR)
    • nrf52840_xxaa_mbr.hex (BOOTLOADER)
    • dfu_client.hex (EXAMPLE HEX)

    In order to have my application working, I have to flash:

    • s140_nrf52_7.0.1_softdevice.hex (SOFTDEVICE)
    • my_app.hex (APPLICATION HEX)

    At the moment, I have merged the two application codes and, let's say, I have the  

    my_app_DFU.hex

    I have tried to flash all the components:

    1. mbr_nrf52_2.4.1_mbr.hex (MBR)
    2. nrf52840_xxaa_mbr (BOOTLOADER)
    3. s140_nrf52_7.0.1_softdevice.hex (SOFTDEVICE)
    4. my_app_DFU.hex (APPLICATION+DFU HEX)

    I received back this when I flash the SD

    and this when I flash the application

    Moreover, the dongle is stucked with the green led lit up.

    Maybe I am supposed to do some mergehex operations?

    Thanks,

    Alessio 

     

Related