How to start nRF5340 netcore DFU?

Hi,

I am trying to update nRF5340 netcore application, but i don't know how to start.


Here is what i tried:

1. I created two custom applications for nRF5340 appcore and netcore. Very simple, just print the compile time. Appcore additionally has the function of enter the DFU mode.

2. In my appcore application, it has one child image named "MCUboot", and the other child image named "netcore". Looks like this as follow:

          

Note:

- mcuboot_primary: is appcore application running location.

- mcuboot_secondary: is appcore application upgrading location.

mcuboot_primary_1: is netcore application transmission location.

mcuboot_secondary_1: is netcore application upgrading location.

3. I flash appcore upgrading package to ''mcuboot_secondary", and call 'boot_request_upgrade_multi(0, BOOT_UPGRADE_TEST)' in my appcore application.

After reboot, the appcore application can upgrading, but can not reverse. In addition, appcore application confirmed image by 'boot_write_img_confirmed_multi(0)'.

4. I try to flash netcore upgrading package to "mcuboot_secondary_1", and call 'boot_request_upgrade_multi(1, BOOT_UPGRADE_TEST)' in my appcore application.

But the netcore application can not upgrading after reboot.

What did i miss?

Best regards,

Yang Hu

Parents
  • Hi,


    Is your application based on any of the existing NCS samples?

    You could take a look at the discussion in this thread. More information about fota upgrades is available in the documentation.


    Best regards,
    Dejan

  • Hi,

    Is your application based on any of the existing NCS samples?

    No, It's a new application,although it looks like 'hello world' samples.

    You could take a look at the discussion in this thread.

    No storage related subsystems are used in my application.


    In steps 3, after reboot, i see log as follow:

    Image upgrade secondary slot -> primary slot
    I: Erasing the primary slot

    I add 'CONFIG_BOOT_UPGRADE_ONLY=y' in mcuboot.conf, refer to simultaneous-multi-image-dfu. In this link, It's only say the simultaneous update of multiple images does not support network core image reversion, so i think the appcore image should support exchange.

    In steps 4, the netcore upgrading package is not from ~/build/zephyr/core_net_xxx.bin, because there are no files starting with core_net_xxx in this path. It is from ~/build/cpunet/zephyr/signed_by_b0_app.bin, 'cpunet' is the name of the child image.

  • I can't print more log in the MCUboot, follow this serial-mcuboot-log-print-on-ses-debug-terminal.

    My log like this:

    [15:44:55.938]rx←◆*** Booting Zephyr OS build v3.0.99-ncs1  ***
    I: Starting bootloader
    W: current image_index: 0.
    I: Swap type: test
    I: area_id: 3.
    I: BOOT_CURR_IMG(state): 0.
    I: slot: 1.
    W: current image_index: 1.
    I: Swap type: none
    I: area_id: 5.
    I: BOOT_CURR_IMG(state): 0.
    I: slot: 0.
    
    [15:44:56.141]rx←◆I: area_id: 2.
    I: BOOT_CURR_IMG(state): 1.
    I: slot: 0.
    I: Bootloader chainload address offset: 0x10000
    I: Jumping to the first image slot*** Booting Zephyr OS build v3.0.99-ncs1  ***
    

    But i want more log like this:

    #define BOOT_LOG_SWAP_STATE(area, state)                            \
        BOOT_LOG_INF("%s: magic=%s, swap_type=0x%x, copy_done=0x%x, "   \
                     "image_ok=0x%x",                                   \
                     (area),                                            \
                     ((state)->magic == BOOT_MAGIC_GOOD ? "good" :      \
                      (state)->magic == BOOT_MAGIC_UNSET ? "unset" :    \
                      "bad"),                                           \
                     (state)->swap_type,                                \
                     (state)->copy_done,                                \
                     (state)->image_ok)

    I mark debug info at this line, in file "bootutil_priv.h", it can be assert. but no more log print.

    #if !defined(MCUBOOT_OVERWRITE_ONLY) && \
        !defined(MCUBOOT_SWAP_USING_MOVE) && \
        !defined(MCUBOOT_DIRECT_XIP) && \
        !defined(MCUBOOT_RAM_LOAD)
    #define MCUBOOT_SWAP_USING_SCRATCH 1
    #error "using scratch"
    #endif

    I'm confused that there is no penalty for assert information here, in file "swap_scratch.c".
    int
    swap_status_source(struct boot_loader_state *state)
    {
        const struct boot_status_table *table;
    #if MCUBOOT_SWAP_USING_SCRATCH
        struct boot_swap_state state_scratch;
        #error "error should"
    #endif


    Here is my project:
    nRF5340_dfu.7z

  • Hi,

    Which NCS version do you use and for which board did you perform build?

    Best regards,
    Dejan

  • Hi,

    I am using NCS V2.0.0, and board is nRF5340.

  • Hi,

    Do you use VS Code to build your project?

    In VS Code, which board name did you use when you created your build configuration?

    Best regards,
    Dejan

  • Hi,

    Yes, i use VS Code. And build board name is nrf5340dk_nrf5340_cpuapp.

    Best regards,

    Yang Hu

Reply Children
Related