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.

Parents
  • Hello,

    I'm not sure why this is happening. I suspect it might be because of the connection parameters you are using in the application. For testing, try doing a DFU to a device running the OTA sample (where the firmware image is your custom application and the device is running the OTA sample) and vice versa (a device running your firmware and the new image to update is the OTA sample).

    If that also doesn't work, please share a minimal project or minimal prj.config. I will try to test it here.

    Kind regards,

    Abhijith

  • Hi, 

    Thanks for the update.

    We tested both methods, that you suggested, but nothing positive. prj.conf is attached. please have a look.

    CONFIG_MAIN_STACK_SIZE= 10240
    
    #for LOG
    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=y
    CONFIG_LOG_RUNTIME_FILTERING=y
    CONFIG_LOG_BUFFER_SIZE=10240
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0
    CONFIG_LOG_TAG_MAX_LEN=8
    
    #for timer
    CONFIG_NRFX_TIMER0=y
    
    #for events
    CONFIG_EVENTS=y
    
    #for fuel gauge
    CONFIG_FUEL_GAUGE=y
    
    #for I2C
    CONFIG_I2C=y
    
    #for dmic
    CONFIG_AUDIO=y
    CONFIG_AUDIO_DMIC=y
    CONFIG_DMA=y
    
    #for NVS
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_NVS=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    #for RTC
    CONFIG_NRFX_RTC0=y
    
    #To enable floating point values
    CONFIG_FPU=y
    
    #for SPI
    CONFIG_SPI=y
    CONFIG_NRFX_SPIM2=y
    CONFIG_NRFX_SPIM4=y
    
    #for Bluetooth
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=n
    CONFIG_BT_SMP=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_BAS=y
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_DEVICE_NAME="test"
    CONFIG_BT_DIS_MODEL="test"
    CONFIG_BT_DIS_MANUF="test"
    CONFIG_BT_DIS_HW_REV=y
    CONFIG_BT_DIS_HW_REV_STR="0.1.1"
    CONFIG_BT_DIS_SW_REV=y
    CONFIG_BT_DIS_SW_REV_STR="0.0.1"
    CONFIG_BT_DIS_FW_REV=y
    CONFIG_BT_DIS_FW_REV_STR="0.0.1.1"
    #GATT_CLIENT needed for requesting ATT_MTU update
    CONFIG_BT_GATT_CLIENT=y
    #PHY update needed for updating PHY request
    CONFIG_BT_USER_PHY_UPDATE=y
    #For data length update
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    #Over-ride various BT settings for extended data packet size
    CONFIG_BT_ATT_PREPARE_COUNT=4
    CONFIG_BT_L2CAP_TX_MTU=498
    CONFIG_BT_L2CAP_TX_FRAG_COUNT=15
    CONFIG_BT_BUF_EVT_RX_SIZE=251
    CONFIG_BT_BUF_CMD_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_BUF_ACL_TX_COUNT=15
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_RX_STACK_SIZE=4096
    CONFIG_BT_DEVICE_APPEARANCE=833
    
    #for UART
    CONFIG_UART_INTERRUPT_DRIVEN=n
    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_3_ASYNC=y
    CONFIG_UART_USE_RUNTIME_CONFIGURE=y
    
    #for Warchdog
    CONFIG_WATCHDOG=y
    CONFIG_WDT_DISABLE_AT_BOOT=n
    
    #for OTA 
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
    CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
    CONFIG_UPDATEABLE_IMAGE_NUMBER=2
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
    
    
    #for ota callback
    CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y
    CONFIG_MCUMGR_GRP_IMG_STATUS_HOOKS=y
    
    CONFIG_PCD_APP=y

    Thanks in advance.

Reply
  • Hi, 

    Thanks for the update.

    We tested both methods, that you suggested, but nothing positive. prj.conf is attached. please have a look.

    CONFIG_MAIN_STACK_SIZE= 10240
    
    #for LOG
    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=y
    CONFIG_LOG_RUNTIME_FILTERING=y
    CONFIG_LOG_BUFFER_SIZE=10240
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0
    CONFIG_LOG_TAG_MAX_LEN=8
    
    #for timer
    CONFIG_NRFX_TIMER0=y
    
    #for events
    CONFIG_EVENTS=y
    
    #for fuel gauge
    CONFIG_FUEL_GAUGE=y
    
    #for I2C
    CONFIG_I2C=y
    
    #for dmic
    CONFIG_AUDIO=y
    CONFIG_AUDIO_DMIC=y
    CONFIG_DMA=y
    
    #for NVS
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_NVS=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    #for RTC
    CONFIG_NRFX_RTC0=y
    
    #To enable floating point values
    CONFIG_FPU=y
    
    #for SPI
    CONFIG_SPI=y
    CONFIG_NRFX_SPIM2=y
    CONFIG_NRFX_SPIM4=y
    
    #for Bluetooth
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=n
    CONFIG_BT_SMP=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_BAS=y
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_DEVICE_NAME="test"
    CONFIG_BT_DIS_MODEL="test"
    CONFIG_BT_DIS_MANUF="test"
    CONFIG_BT_DIS_HW_REV=y
    CONFIG_BT_DIS_HW_REV_STR="0.1.1"
    CONFIG_BT_DIS_SW_REV=y
    CONFIG_BT_DIS_SW_REV_STR="0.0.1"
    CONFIG_BT_DIS_FW_REV=y
    CONFIG_BT_DIS_FW_REV_STR="0.0.1.1"
    #GATT_CLIENT needed for requesting ATT_MTU update
    CONFIG_BT_GATT_CLIENT=y
    #PHY update needed for updating PHY request
    CONFIG_BT_USER_PHY_UPDATE=y
    #For data length update
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    #Over-ride various BT settings for extended data packet size
    CONFIG_BT_ATT_PREPARE_COUNT=4
    CONFIG_BT_L2CAP_TX_MTU=498
    CONFIG_BT_L2CAP_TX_FRAG_COUNT=15
    CONFIG_BT_BUF_EVT_RX_SIZE=251
    CONFIG_BT_BUF_CMD_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_BUF_ACL_TX_COUNT=15
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_RX_STACK_SIZE=4096
    CONFIG_BT_DEVICE_APPEARANCE=833
    
    #for UART
    CONFIG_UART_INTERRUPT_DRIVEN=n
    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_3_ASYNC=y
    CONFIG_UART_USE_RUNTIME_CONFIGURE=y
    
    #for Warchdog
    CONFIG_WATCHDOG=y
    CONFIG_WDT_DISABLE_AT_BOOT=n
    
    #for OTA 
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
    CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
    CONFIG_UPDATEABLE_IMAGE_NUMBER=2
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
    
    
    #for ota callback
    CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y
    CONFIG_MCUMGR_GRP_IMG_STATUS_HOOKS=y
    
    CONFIG_PCD_APP=y

    Thanks in advance.

Children
No Data
Related