Unable to perform MCUMGR_BT_OTA_DFU with UART on application

Hi,

To prepare our new device, we are using a nrf5340dk board.

For our application, we need to perform DFU over BT.

Si, i following the tutorial https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/topic/exercise-3-fota-over-bluetooth-low-energy/ and everything working well on the board.

So, in my application i add the following line on prj.conf

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

And, then, when i want to perform DFU with my android using nrf connect, my device is stuck, and on nrf connect i have the message " Starting DFU" (see pictures below)

 and see the last log on console on nrf5340 dk

[00:07:31.898,773] <inf> mcuboot_util: Image index: 0, Swap type: none
[00:07:32.031,677] <inf> mcuboot_util: Image index: 0, Swap type: none
[00:07:32.046,569] <inf> mcuboot_util: Image index: 0, Swap type: none

After some research, i found that if i not enable my uart device, DFU are working well. More precisely if i not enable the rx.

See my code to init uart 

int uart1_init(void)
{
    int err;

	if (!device_is_ready(uart1))
    {
		LOG_ERR("UART device not ready\r\n");
		return -1 ;
	}

    err = uart_callback_set(uart1, uart1_cb, NULL);
    if (err)
    {
        return err;
    }

    // DFU working if line below commented
    err = uart_rx_enable(uart1 ,uart1_rx_buf,sizeof(uart1_rx_buf),RX_TIMEOUT_US);
    return err;
}

If i use uart_rx_disable once a connection is detected, then DFU perform working well.

Could you help me on this issue ? I don't want to perform a DFU by UART, but only by BT so disable CONFIG_SERIAL on mcuboot.conf, but still have the same issue.

Thanks in advance,

Best Regards,

Julien F.

Parents
  • Hello Julien,

    Does the log from the application say anything when it doesn't work? 

    I don't want to perform a DFU by UART, but only by BT so disable CONFIG_SERIAL on mcuboot.conf

    The CONFIG_SERIAL in mcuboot.conf probably doesn't affect this, since when you are transferring the new application image, it is the application that is running, but only during the swapping process. 

    Do you see any events in the UART event handler when the issue occurs? 

    Do you use the default UART pins? 

    Best regards,

    Edvin

Reply
  • Hello Julien,

    Does the log from the application say anything when it doesn't work? 

    I don't want to perform a DFU by UART, but only by BT so disable CONFIG_SERIAL on mcuboot.conf

    The CONFIG_SERIAL in mcuboot.conf probably doesn't affect this, since when you are transferring the new application image, it is the application that is running, but only during the swapping process. 

    Do you see any events in the UART event handler when the issue occurs? 

    Do you use the default UART pins? 

    Best regards,

    Edvin

Children
No Data
Related