Seeking DFU-OTA Example for nRF5340 with Latest SDK

Hello,

I'm currently looking for a comprehensive example of DFU-OTA (Device Firmware Update Over-the-Air) using the latest SDK version with the nRF5340 platform. If anyone has successfully implemented DFU-OTA or can provide guidance on where to find reliable resources, I would greatly appreciate your assistance.

I am encountering issues with DFU-OTA on the nRF5340 platform after updating to the latest SDK version (specifically using SDK v2.6.1 and toolchain v2.7.0). The main challenges include:

1. Successful Image Transfer: Ensuring that the new firmware image is transferred correctly to the device.
2. Post-DFU Behavior: Understanding the expected behavior after initiating DFU, including device restarts and connection status.

If anyone has a working example or can point me to a detailed guide or tutorial on implementing DFU-OTA with the latest SDK (v2.6.1), it would be immensely helpful. I'm particularly interested in:

a. Detailed steps or code snippets for setting up DFU-OTA.
b. Best practices or common pitfalls to avoid during DFU-OTA implementation.
c. Guidance on troubleshooting and debugging DFU-OTA issues, especially with the nRF5340 platform.

Your insights and experiences with DFU-OTA on Nordic Semiconductor's platforms are invaluable. Any assistance in resolving my current challenges or pointing me in the right direction for resources would be highly appreciated.

  • Hello,

    I tested this using your prj.conf file but was unable to reproduce the issue on my end. I integrated your entire prj.conf into my test application for OTA DFU and attempted the DFU with the generated image to a device. However, I did not experience the delay that your logs indicate.

    Could you clarify how you're measuring this delay of over 1 minute? I am attaching the log of my DFU process; none of the timestamps show a time difference of over 1 minute.

    I've attached the generated build/.config file. Please review it and let me know if I missed any important configurations.

    build_config.zip

    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Starting Bluetooth Peripheral LBS example
    I: 2 Sectors of 4096 bytes
    I: alloc wra: 0, fd0
    I: data wra: 0, 1c
    I: HW Platform: Nordic Semiconductor (0x0002)
    I: HW Variant: nRF53x (0x0003)
    I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    I: Identity: D9:76:44:D8:3F:05 (random)
    I: HCI: version 5.4 (0x0d) revision 0x218f, manufacturer 0x0059
    I: LMP: version 5.4 (0x0d) subver 0x218f
    Advertising successfully started
    Connected
    I: Image index: 0, Swap type: none
    I: Image index: 1, Swap type: none
    E: Failed to open flash area ID 1: -2
    I: Image index: 0, Swap type: none
    I: Image index: 1, Swap type: none
    E: Failed to open flash area ID 1: -2
    I: Image index: 1, Swap type: none
    I: Image index: 0, Swap type: none
    I: Image index: 1, Swap type: perm
    E: Failed to open flash area ID 1: -2
    I: Image index: 0, Swap type: none
    I: Image index: 0, Swap type: perm
    I: Image index: 1, Swap type: perm
    E: Failed to open flash area ID 1: -2
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Starting Bluetooth Peripheral LBS example
     [00:00:00.006,805] <inf> fs_nvs: 2 Sectors of 4096 bytes
     [00:00:00.006,835] <inf> fs_nvs: alloc wra: 0, fe8
     [00:00:00.006,835] <inf> fs_nvs: data wra: 0, 0
     [00:00:00.037,811] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
     [00:00:00.037,841] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
     [00:00:00.037,872] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
     [00:00:00.040,283] <inf> bt_hci_core: No ID address. App must call settings_load()
    Bluetooth initialized
     [00:00:00.042,755] <inf> bt_hci_core: Identity: D9:76:44:D8:3F:05 (random)
     [00:00:00.042,785] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x218f, manufacturer 0x0059
     [00:00:00.042,785] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x218f
    Advertising successfully started
    Connected
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Starting Bluetooth Peripheral LBS example
     [00:00:00.006,622] <inf> fs_nvs: 2 Sectors of 4096 bytes
     [00:00:00.006,622] <inf> fs_nvs: alloc wra: 0, fd0
     [00:00:00.006,622] <inf> fs_nvs: data wra: 0, 1c
     [00:00:00.037,841] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
     [00:00:00.037,872] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
     [00:00:00.037,902] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
     [00:00:00.040,313] <inf> bt_hci_core: No ID address. App must call settings_load()
    Bluetooth initialized
     [00:00:00.042,816] <inf> bt_hci_core: Identity: D9:76:44:D8:3F:05 (random)
     [00:00:00.042,846] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x218f, manufacturer 0x0059
     [00:00:00.042,877] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x218f
    Advertising successfully started
    Connected

    Kind regards,
    Abhijith

Related