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
Reply
  • 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
Children
  • Yes the base of my app is the nRF5340 Audio application and I checked the mcuboot.conf and it had config_pcd_app=y

    After I upload the network image and set it to pending, I get the following:

    Images:
    image=0 slot=0
    version: 1.0.0
    bootable: true
    flags: active confirmed
    hash: 072aa80e3c92d3ca08276940a2d579e1e0eef37bf3c74ef3101f88afe3d4c12a
    image=0 slot=1
    version: 1.0.0
    bootable: true
    flags: pending
    hash: 7addd470b9de927f779af054a3df995ce2e297778605ff346c974696a1ebfa84
    Split status: N/A (0)

    Is it OK? Should the network and app images be in different slot?

  • Yes the base of my app is the nRF5340 Audio application and I checked the mcuboot.conf and it had config_pcd_app=y

    After I upload the network image and set it to pending, I get the following:

    Images:
    image=0 slot=0
    version: 1.0.0
    bootable: true
    flags: active confirmed
    hash: 072aa80e3c92d3ca08276940a2d579e1e0eef37bf3c74ef3101f88afe3d4c12a
    image=0 slot=1
    version: 1.0.0
    bootable: true
    flags: pending
    hash: 7addd470b9de927f779af054a3df995ce2e297778605ff346c974696a1ebfa84
    Split status: N/A (0)

    Is it OK? Should the network and app images be in different slot?

  • I found out the solution - I had to add the bootloader also to the network processor.

    Thanks.

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

Related