Difference between BLE DFU and UART DFU

Hi I am testing DFU using NRF52840 DK board.
I am using nrf connect sdk v2.2.0
I am developing code with zephyr rtos using vscode
Firmware is updated using the SMP protocol using the MCUMGR library.

BLE dfu was performed using nrf connect app, and uart dfu was performed using Auterm.exe.

When the firmware update is completed, BLE dfu reboots itself and, upon bootloading, copies the standby firmware image with the new firmware to the active firmware image and saves it.
When I tested it, I confirmed that when I update the firmware using ble dfu, it automatically changes to the new firmware code, and even if I turn the board off and on, it works with the new firmware.

The uart dfu does not change to the new firmware after the firmware update is completed.
If I forcibly turn off and turn on the DK board, it is changed to the new firmware.
But the bigger problem here is that if you turn the dk board off and on again, it returns to the previous firmware.

I am testing using the peripheral_hr example
Below is the code I used

I added it to main(void)
    
os_mgmt_register_group();

    img_mgmt_register_group();
    stat_mgmt_register_group();
    err = smp_bt_register();
    if (err) {
    printk("SMP BT register failed (err: %d)", err);
    }
I added it to prj.conf
# Enable mcumgr.
CONFIG_MCUMGR=y

# Some command handlers require a large stack.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

# Enable flash operations.
CONFIG_FLASH=y

# Required by the `taskstat` command.
CONFIG_THREAD_MONITOR=y

# Enable statistics and statistic names.
CONFIG_STATS=y
CONFIG_STATS_NAMES=y

# Enable most core commands.
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_STAT_MGMT=y

# Allow for large Bluetooth data packets.
CONFIG_BT_L2CAP_TX_MTU=252
CONFIG_BT_BUF_ACL_RX_SIZE=256

# Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n
# CONFIG_MCUMGR_SMP_SHELL=y
CONFIG_MCUMGR_SMP_UART=y

I think what I need to make uart dfu operate like ble dfu is CONFIG_MCUMGR_SMP_UART=y.
Is there any other code or anything else I need?

I would really appreciate it if you could help me.

Parents Reply
  • Min Hyuk said:
    The reason for this is because the nRF52840dk board I use does not support UDP.
    Is there a way to update firmware via udp? and
    Is it possible to update the firmware for this scenario I need to develop?

    To use the ECM5200-UART module for the nRF52840, you will need a driver for this to run in your nRF52840 firmware.

    Once you have that, I think/hope that you simply can configure the DFU to use UDP instead of UART with CONFIG_MCUMGR_TRANSPORT_UDP. But yes you first need to make sure that you are able to use the ethernet and UDP via the module.

    PS: Serial recovery only supports UART and USB, and not UDP.

Children
Related