Not able to update firmware over UART using MCUboot: flag shows pending

I tried to update firmware over UART (using MCUboot).

The flag shows test pending, and was able to test the application and provide expected output.

But was not able to "confirm image", it shows Error:NMP timeout, when the confirm image command is executed.

Thanks in advance

Parents Reply Children
  • This works fine on my end.

    Turns out that CONFIG_MCUBOOT_INDICATION_LED only works for Button mode, and is not supported for Wait mode.

    If you want to enable this for Wait mode, you can apply these changes  temporarily to MCUboot:

    diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
    index 2c5f9afd..3081f845 100644
    --- a/boot/zephyr/main.c
    +++ b/boot/zephyr/main.c
    @@ -620,9 +620,14 @@ void main(void)
          * some time, so it's better to reuse thistime to already receive the
          * initial mcumgr command(s) into our buffers
          */
    +
    +#ifdef CONFIG_MCUBOOT_INDICATION_LED
    +        gpio_pin_set_dt(&led0, 1);
    +#endif
         rc = boot_console_init();
         int timeout_in_ms = CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT;
         uint32_t start = k_uptime_get_32();
    +
     #endif
     
         FIH_CALL(boot_go, fih_rc, &rsp);
    @@ -646,6 +651,10 @@ void main(void)
             timeout_in_ms = 1;
         }
         boot_serial_check_start(&boot_funcs,timeout_in_ms);
    +
    +#ifdef CONFIG_MCUBOOT_INDICATION_LED
    +        gpio_pin_set_dt(&led0, 0);
    +#endif
     #endif
     
         if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) {
    

    Are you able to see that sys_reboot(SYS_REBOOT_COLD) works with these changes?

  •   Now the bootloader lit's up the LED for 5 sec and waits for mcumgr command and if there are no commands send in 5 sec then LED turn off (works as expected)

    But after updating the application firmware, and resetting the device, then later the LED turns ON back after 5 secs and never runs the application.

    And it works fine if the below configs are not included:

    # Enable wait for DFU functionality
    CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y
    CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=10000

     

  • lorao said:
    CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y
    CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=10000

    I tried this briefly, and I can update the application multiple times.

    Can you upload a zip of the sample you use so I can use that to reproduce?

  •   Please find the attachment below:
    Issue: I can update the image file but the application does not run after update And also it stays in the bootloader mode.
    Thank you

  • Your sample works for me. See the recording:

Related