NRF5340 Audio net core app update

Hi,

I developing an Hearing aid accessory with nrf5340 audio and STM32.

I do not have external flash so I need to use the nrf5340 internal flash.

I'm using the 2.5.0 SDK and I succeeded to update the application image with the mcumgr over the USB CDC ACM connected to the nrf5340.

Is it possible to update the network image without external flash and by the serial port?

If yes, Do you have any example for it?

  • Hi Amanda,

    I updated my application to NCS v2.7.0.

    I see that the serial recovery was changed from v2.5.0.

    Can you guide me how to add the serial recovery over CDC USB?

    Do I need to do it via Sysbuild?

  • Hi, 

    Omri said:
    Can you guide me how to add the serial recovery over CDC USB?

    You can take a look at this course

    For v2.7.0, you can use the overlay-serial-USB.conf to include the relevant configs; add these lines to mcuboot.overlay and mcuboot.conf. It will get into USB recovery mode by holding BTN3 (PLAY/PAUSE) while resetting the Audio DK. 

    Omri said:
    Do I need to do it via Sysbuild?

    All samples and applications in the SDK are built with sysbuild by default. Applications that are outside the SDK are not built with sysbuild by default.

    Please also be aware that Updating the SoftDevice in NCS v2.7.0:

    Both FOTA upgrade methods support updating the SoftDevice on the network core. However, the current default build options for the SoftDevice create a binary that is too large to run on the network core together with a bootloader. To reduce the size of the SoftDevice binary, you can disable unused features in the SoftDevice. See SoftDevice Controller documentation for more information. 

    -Amanda H.

  • Hi Amanda,

    I add the USB CDC Serial Recovery to the nrf5340 audio application based on sysbuild config on NCS v2.7.0

     However, I get the following partition error:

    FAILED: zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.7.0/bootloader/mcuboot/boot/boot_serial/src/boot_serial.c.obj 
    C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"mcuboot-mbedtls-cfg.h\" -DNCS_APPLICATION_BOOT_BANNER_GIT_REPO -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.7.0/zephyr/kernel/include -IC:/ncs/v2.7.0/zephyr/arch/arm/include -IC:/ncs/v2.7.0/zephyr/include -IC:/nuance/leaudio_pod/ble/platform/nordic5340/build/mcuboot/zephyr/include/generated -IC:/ncs/v2.7.0/zephyr/soc/nordic -IC:/ncs/v2.7.0/zephyr/soc/nordic/nrf53/. -IC:/ncs/v2.7.0/zephyr/soc/nordic/common/. -IC:/ncs/v2.7.0/nrf/include -IC:/ncs/v2.7.0/nrf/tests/include -IC:/ncs/v2.7.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.7.0/zephyr/modules/cmsis/. -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.7.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.7.0/modules/lib/zcbor/include -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/include -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/boot_serial/include -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/src -IC:/ncs/v2.7.0/modules/crypto/mbedtls/include -IC:/ncs/v2.7.0/modules/crypto/mbedtls/include/library -IC:/ncs/v2.7.0/modules/crypto/mbedtls/library -IC:/ncs/v2.7.0/zephyr/modules/mbedtls/configs -IC:/ncs/v2.7.0/zephyr/modules/mbedtls/include -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/.. -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/../include -IC:/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -isystem C:/ncs/v2.7.0/zephyr/lib/libc/minimal/include -isystem C:/ncs/v2.7.0/zephyr/lib/libc/common/include -isystem c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -isystem C:/ncs/v2.7.0/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros C:/nuance/leaudio_pod/ble/platform/nordic5340/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.7.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.7.0/bootloader/mcuboot/boot/boot_serial/src/boot_serial.c.obj -MF zephyr\CMakeFiles\zephyr.dir\C_\ncs\v2.7.0\bootloader\mcuboot\boot\boot_serial\src\boot_serial.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.7.0/bootloader/mcuboot/boot/boot_serial/src/boot_serial.c.obj -c C:/ncs/v2.7.0/bootloader/mcuboot/boot/boot_serial/src/boot_serial.c
    In file included from C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:10,
                     from C:/ncs/v2.7.0/bootloader/mcuboot/boot/boot_serial/src/boot_serial.c:27:
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h: In function '__flash_area_ids_for_slot':
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:48:62: error: 'PM_MCUBOOT_SECONDARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_SECONDARY_ID'?
       48 | #define FLASH_AREA_IMAGE_1_SLOTS    PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
          |                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
       55 |                             FLASH_AREA_IMAGE_1_SLOTS
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
       67 |         ALL_AVAILABLE_SLOTS
          |         ^~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:48:62: note: each undeclared identifier is reported only once for each function it appears in
       48 | #define FLASH_AREA_IMAGE_1_SLOTS    PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
          |                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
       55 |                             FLASH_AREA_IMAGE_1_SLOTS
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
       67 |         ALL_AVAILABLE_SLOTS

    Are you familiar with that error? do you have solution for this?

    Omri.

  • No. the post was regarding DFU over BT with external flash while I use DFU over USB CDC without external flash.

    Is it possible to build my project or the ipc radio without the Sysbuild? 

Related