nrf5340 audio: FOTA Firmware can't build

We have a project based on nrf5340 audio demo,Now we upgrade SDK from NCS2.4 to NCS2.6.

But when I built the DFU, I found that FLASH was not enough

c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `text' will not fit in region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 20308 bytes

I know this problem exists in NCS2.5.99 and the reason is, but NCS2.6 should have fixed it?

I know that I need to cut the controller. For BIS headset and BIS gateway, what configurations can I use to reduce the size?

Parents
  • Hi,

    Which board do you use?

    But when I built the DFU, I found that FLASH was not enough

    Could you provide a complete log?

    I know this problem exists in NCS2.5.99

    Could you provide a reference for this?

    Best regards,
    Dejan

  • Hi,dejans,

      The above is the complete log. The other logs have nothing to do with this problem. The only problem is that region `FLASH' overflowed.
    For NCS2.5.99, it is clearly stated that FOTA cannot be used, so there is no need to test.
    For NCS2.6.0, the instructions provided are as follows:
    Updating the SoftDevice:
    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.

    What I want to know is which configs I can modify to reduce the size of the softDevice controller.

    At the same time, it does not affect BIS functions.

    Best regards,

    Reskyllr

  • Hi Ahmd,

    Ahmed Moheb said:
    As I'm facing the same problem, it's clear from the begining that it's not an issue with the FOTA operation itself, it's about the size of the generated binary of the SoftDevice controller.

    I agree that the problem is with the size of the binary.

    Ahmed Moheb said:

    Reskyllr is asking about which configuration options can be disabled to reduce the size of the SoftDevice controller image without breaking the broadcast usecase for GW/HS.

    This is totally independent of whether you are building the application CONFIG_AUDIO_DFU=1 for single image or CONFIG_AUDIO_DFU=2 for multimage upgrade

    I understand this. My first two questions were just requests for confirmation. The main question is about the set of features that are planned to be used since this determines which config options should be included and which could be excluded.

    Best regards,
    Dejan


  • Hi  

    Thanks for the clarification and sorry if I miss understood the goal of your questions.

    I don't want to take the discussion in another direction, but I think it may help.
    Can you propose the required configurations for an ISO peripheral device that would receive a CIS ISO stream and send it again as BIS ISO stream while supporting the FOTA operation.

    Thanks in advance,
    Ahmed

  • Hi all,

    Reskyllr, there are some configuration options which you could set to avoid flash overflow.

    CONFIG_BT_ISO_PERIPHERAL=n
    CONFIG_BT_CENTRAL=n
    CONFIG_BT_PERIPHERAL=n

    Ahmed Moheb said:
    Can you propose the required configurations for an ISO peripheral device that would receive a CIS ISO stream and send it again as BIS ISO stream while supporting the FOTA operation.

    In addition to CONFIG_BT_CENTRAL=n, try setting CONFIG_BT_ISO_SYNC_RECEIVER=n.

    Best regards,
    Dejan




  • Hi,dejans,

    I've tried these settings:
    CONFIG_BT_ISO_BROADCASTER=n
    CONFIG_BT_ISO_SYNC_RECEIVER=n
    If these settings are applied, PA synchronization will not be possible.

    Are there any other config settings I can try?

    I use CONFIG_AUDIO_DFU=2,In NCS2.4.0,We have mass produced.

    Best regards,

    Reskyllr

  • Hi Reskyllr,

    Have you tried to add CONFIG_BT_PERIPHERAL=n as well?

    Best regards,
    Dejan

Reply Children
  • Hi,dejans,

    This is valid and can be compiled successfully, but SMP broadcasts will not be created successfully, which is necessary for FOTA:
    HL [00:00:00.024139]<wrn>bt_hci_core: opcode 0x2036 status 0x11
    HL [00:00:00.024139]<err>bt_mgmtdfu: SMP_SVR Advertising failed to start (ret-5)

    Best regards,

    Reskyllr

  • Hi Reskyllr,

    Reskyllr said:
    HL [00:00:00.024139]<wrn>bt_hci_core: opcode 0x2036 status 0x11
    HL [00:00:00.024139]<err>bt_mgmtdfu: SMP_SVR Advertising failed to start (ret-5)

    Can you confirm that this error happens with config options that are shown below?

    CONFIG_BT_ISO_PERIPHERAL=n
    CONFIG_BT_CENTRAL=n
    CONFIG_BT_PERIPHERAL=n

    Best regards,
    Dejan

  • Hi,dejans,

    I've fixed the problem and now it works smoothly, albeit with flash woes.
    It is hoped that the size can be reduced as soon as possible, because adding the CIS function is obviously unrealistic at present.

    Best regards,

    Reskyllr

  • Hi  ,

    I hope you don't mind sharing how you managed to solve it.

    Could you share the configuration you used?



    Thanks,

    Ahmed

  • Be sure,

    hci_ipc.conf

    #
    # Copyright (c) 2023 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    CONFIG_BT_ISO_PERIPHERAL=y
    # CONFIG_BT_ISO_CENTRAL=y
    # CONFIG_BT_ISO_BROADCASTER=y
    # CONFIG_BT_ISO_SYNC_RECEIVER=y
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER=n
    CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER=n
    CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1
    CONFIG_BT_CTLR_CONN_ISO_GROUPS=1
    CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
    CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=2
    CONFIG_BT_CTLR_ADV_ISO_SET=1
    CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=2
    
    # Support two links as a central, or one link as a peripheral
    CONFIG_BT_MAX_CONN=3
    CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1
    
    # Allow using more than default advertising event length
    CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=251
    
    # To present the audio at the right point in time, we need the controller and
    # audio clock to be synchronized
    CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START=y
    CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START_CHANNEL=4
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y
    #
    # If using FEM the CONFIG_BT_CTLR_TX_PWR_ANTENNA should be set here if the
    # value required is not 10 dBm
    #
    
    # hdeadset needn't
    CONFIG_BT_ISO_CENTRAL=n
    #CONFIG_BT_PERIPHERAL=n
    CONFIG_BT_ISO_PERIPHERAL=n
    
    CONFIG_BT_ISO_BROADCASTER=y
    CONFIG_BT_ISO_SYNC_RECEIVER=y
    CONFIG_DEBUG=n
    CONFIG_ASSERT=n
    CONFIG_STACK_USAGE=n
    CONFIG_THREAD_MONITOR=n
    CONFIG_SERIAL=n
    CONFIG_CONSOLE=n
    CONFIG_PRINTK=n
    CONFIG_UART_CONSOLE=n
    CONFIG_BOOT_BANNER=n

    Please note that it only supports BIS.

    Best regards,

    Reskyllr

Related