net core update via SMP server via nrfConnect on android?

I am testing with nrf5340 on NCS 2.3.0.

I added SMP server functionality to a sample application  (peripheral_lbs).  I added secureboot b0, mcuboot, tf-m  to the application processor and secure boot b0n and tfm to the network processor.  

I was able to successfully update the application using app_update.bin in nrfConnect for Android using the DFU button. 

The update failed and mcuboot was stuck in a loop when I tried to send the net_core_app_update.bin in the same way using the nrf Connect for Android DFU feature.

1) Does the android DFU support updating the net_core_app ?

2) For non-simultaneous updates do I need additional flags such as CONFIG_PCD_APP, CONFIG_BOOT_UPGRADE_ONLY, or CONFIG_UPDATEABLE_IMAGE_NUMBER=2  ?

3) I could not find mcuboot_update.bin or s1_update.bin.  Is there special kconfig necessary to generate update.bin for mcuboot s0 or s1?

Parents Reply Children
  • Regarding android DFU update of the net_core_app...

    I sent the net_core_update.bin with android dfu and the application processor became stuck in an endless update loop.  I would see messages from mcuboot over and over.   I suspect the net_core_update.bin was applied as if it was app_update.bin.  I didn't have enough time to fully investigate, but from my limited testing it does NOT work.  Its very concerning that it was possible to brick the device (stuck in endless loop) with a DFU.  This suggests a flaw in the DFU/FOTA design.  

    Regarding point 3, yes I have implemented the steps necessary to get mcuboot and the s1 variant built.  I am getting dfu_mcuboot.zip which I have used for updates with nrf9160 from NRF Cloud, but I don't see any **update.bin other then the net_core_update.bin and app_update.bin.

    Is there a working example that shows generation of the update files for all components of nrf5340?  

  • Hi,

    I've spent some time attempting to recreate the infinite update loop, but so far updating the netcore non-simultaneously works. I would like to add that we typically recommend you to perform the simultaneous update using the generated dfu_application.zip instead whenever you do update over BLE. This is to better ensure that the update will be done in proper order.

    But I don't want to exclude that what you're observing is a bug with the application, so to further investigate, could you state which Android OS and phone you're using? 

    Anthony Ambuehl said:
    Is there a working example that shows generation of the update files for all components of nrf5340?  

    As I mentioned earlier, https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp/mcuboot_smp_uart and github.com/.../mcuboot_smp_ble does what you want to do. You will have to apply a patch to make it work in v2.3.0, 

    diff --git a/bootloader_samples/smp/mcuboot_smp_uart/src/main.c b/bootloader_samples/smp/mcuboot_smp_uart/src/main.c
    index 77a7b1f..4b86477 100644
    --- a/bootloader_samples/smp/mcuboot_smp_uart/src/main.c
    +++ b/bootloader_samples/smp/mcuboot_smp_uart/src/main.c
    @@ -5,10 +5,8 @@
      */
    
    #include <zephyr/kernel.h>
    -#include "img_mgmt/img_mgmt.h"
    
    void main(void)
    {
    -    img_mgmt_register_group();
            printk("Change this to see it change.\n");
    }

    You can also use the zephyr smp sample: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html This sample does only contain how to add DFU over various means, among them BLE. If you wish to add an uppdatable bootloader to this to generate the s0 and s1 files for the uppdatable bootloader, you will have to add the features 

    When you get this sample up and running, merge it with https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/updatable_bootloader/nsib_mcuboot_smp which is a sample showing the updatable bootloader.

    Kind regards,
    Andreas

Related