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?

Parents
  • Hi, 

    Yes, it is possible to update the network core without external flash in single-image DFU. 

    To change the upload for the network core, use

    mcumgr --conntype=serial --connstring="dev=/dev/ttyACM3,baud=115200" image upload build/zephyr/net_core_app_update.bin
    

    Regards,
    Amanda H.

  • Thanks for the fast reply.

    I did it but the nrf5340 was not booted after upload the network and restart the device (the RTT log was empty)

    Could you please check if the following prj.conf is correct?

    CONFIG_NCS_SAMPLE_EMPTY_NET_CORE_CHILD_IMAGE=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_THREAD_NAME=y
    CONFIG_ZCBOR=y
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_PRODUCT="Nuance CDC ACM"
    CONFIG_USB_DEVICE_PID=0x530A
    CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
    CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
    CONFIG_UART_LINE_CTRL=y
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
    CONFIG_B0N_MINIMAL=y
    CONFIG_AUDIO_DFU=1
    CONFIG_MCUMGR=y
    CONFIG_MCUMGR_GRP_OS=y
    CONFIG_MCUMGR_GRP_OS_TASKSTAT=y
    CONFIG_MCUMGR_GRP_STAT=y
    CONFIG_MCUMGR_GRP_IMG=y
    CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=1024
    CONFIG_IMG_MANAGER=y
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y

     

    # nRF5340 Audio
    CONFIG_NRF5340_AUDIO=y
    CONFIG_AUDIO_DEV=2
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    #CONFIG_BT_DEVICE_NAME="NRF5340_AUDIO"
    CONFIG_AUDIO_SOURCE_I2S=y
    CONFIG_AUDIO_SAMPLE_RATE_16000_HZ=y
    CONFIG_BT_CSIP_SET_COORDINATOR=y
    CONFIG_BT_BONDABLE=y
    CONFIG_BT_BAP_UNICAST_CLIENT_LOG_LEVEL_DBG=n
    CONFIG_BT_L2CAP_TX_MTU=300
    CONFIG_BT_AUDIO_BITRATE_UNICAST_SINK=32000
    CONFIG_BT_AUDIO_RETRANSMITS=3
    CONFIG_BT_AUDIO_MAX_TRANSPORT_LATENCY_MS=10
    CONFIG_WDT_CTLR=n
    # General
    CONFIG_DEBUG=n
    CONFIG_ASSERT=n
    CONFIG_STACK_USAGE=n
    CONFIG_THREAD_MONITOR=n
    CONFIG_PRINTK=n
    CONFIG_BOOT_BANNER=n

     

    CONFIG_SHELL=y
    CONFIG_KERNEL_SHELL=y
    CONFIG_USE_SEGGER_RTT=y
    ## Disable logs on RTT
    CONFIG_SHELL_RTT_INIT_LOG_LEVEL_NONE=n
    CONFIG_SHELL_BACKEND_RTT=n
    CONFIG_SHELL_BACKEND_SERIAL=n

    # Uart driver
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_CONSOLE=y
    CONFIG_RTT_CONSOLE=n
    CONFIG_UART_CONSOLE=y
  • Hi Amanda,

    We still have a problem.

    I use nRF5340 Audio application on 2 nRF5340 Audio DK - one as Headset and the other as Gateway.

    I add the CONFIG_AUDIO_DFU = 1 only to the Gateway application and flash the merged_domains.hex.

    While the Headset application was build and flash without the DFU.

    After boot I get in the Gateway application fault as following:

    *** Booting nRF Connect SDK v2.5.0 ***
    GW [00:00:00.005,249] <inf> fw_info:
             nRF5340 Audio nRF5340 Audio DK cpuapp
             NCS base version: 2.5.0
             Cmake run : Tue Jul 23 15:24:34 2024
    GW [00:00:00.005,249] <inf> fw_info: ------- DEBUG BUILD -------
    GW [00:00:00.005,249] <inf> fw_info: Compiled for GATEWAY device
    GW [00:00:00.015,869] <inf> board_version: Compatible board/HW version found: 1.0.0
    GW [00:00:00.056,091] <inf> bt_mgmt_ctlr_cfg: Controller: LL_ACS_NRF53. Version: 3393
    GW [00:00:00.057,983] <inf> bt_mgmt: Local identity addr: DB:F2:56:E1:7D:2E (random)
    GW [00:00:01.257,904] <err> bt_mgmt_ctlr_cfg: Controller not responsive
    GW [00:00:01.257,934] <err> bt_mgmt_ctlr_cfg: ERR_CHK Err_code: [-116] @ line: 146
    GW [00:00:01.257,934] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000002
    GW [00:00:01.257,934] <err> os: r3/a4:  0x20005890 r12/ip:  0x20008168 r14/lr:  0x0001a779
    GW [00:00:01.257,934] <err> os:  xpsr:  0x41100025
    GW [00:00:01.257,934] <err> os: s[ 0]:  0x00000001  s[ 1]:  0x20003e64  s[ 2]:  0x20016260  s[ 3]:  0xffffffff
    GW [00:00:01.257,965] <err> os: s[ 4]:  0x20016260  s[ 5]:  0x000000cd  s[ 6]:  0x2000392c  s[ 7]:  0x00000000
    GW [00:00:01.257,965] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x0001379b  s[10]:  0x00000150  s[11]:  0x00000000
    GW [00:00:01.257,965] <err> os: s[12]:  0x00000000  s[13]:  0x000000cd  s[14]:  0x00000004  s[15]:  0x00071e50
    GW [00:00:01.257,965] <err> os: fpscr:  0xffffff8c
    GW [00:00:01.257,995] <err> os: Faulting instruction address (r15/pc): 0x000137a8
    GW [00:00:01.257,995] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    GW [00:00:01.257,995] <err> os: Fault during interrupt handling
    
    GW [00:00:01.258,026] <err> os: Current thread: 0x20008058 (idle)
    GW [00:00:01.258,026] <err> error_handler: Caught system error -- reason 3. Entering infinite loop

    It looks that once we use the merged_domains.hex file there is a communication problem between the application core and the network core.

    Can you please verify that there is a problem in the hex file and suggest a solution.

    Regards.

  • Hi,

    Do you program the net core?

    If DFU is enabled, the subsystem’s binary file will be generated in the build/zephyr/ directory and will be called net_core_app_signed.hex.

    We are currently understaffed due to the summer vacation period, so delayed replies must be expected. I am sorry about any inconvenience this might cause.

    -Amanda H.

  • Hi Amanda,

    Yes I use the programmer v4.4.0 to program both the net core and the app core.

    I program the net core and app core by merged_domains.hex file that includes both images with boot loader,

    and I also program the net core by net_core_app_signed.hex file and the app core by merged.hex file.

    In both cases I got the same error.

  • 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?

Reply Children
  • 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? 

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

    Please crease a new support case that is away from the original case. 

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

    See the release note:

Related