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 Reskyllr,

    Reskyllr said:
    west build -b nrf5340_audio_dk_nrf5340_cpuapp -p -d headset_dfu -- -DCONFIG_AUDIO_DEV=1 -DCONFIG_AUDIO_DFU=2 -DCONFIG_MCUMGR=y CONFIG_BOOTLOADER_MCUBOOT=y

    I guess this is just a typo on your end, but it should be -DCONFIG_BOOTLOADER_MCUBOOT=y.

    Reskyllr said:
    Is there something wrong with the build instructions I use?

    Apart from what I mentioned above, build command looks fine. Currently, there is a limitation on FOTA upgrade due to updating SoftDevice on the network core in both DFU methods (single and multi-image). SoftDevice binary becomes too large to run on a network core together with a bootloader. Suggested solution for reducing the size of SoftDevice binary would be to disable unused features of the SoftDevice Controller.

    Best regards,
    Dejan 

  • Hi dejans,

    You're right, I'm definitely working in that direction.
    What I need assistance with is: As the controller of Le audio BIS, what features can I disable? I have made some efforts, but the size still cannot meet the needs of dfu.

    Best regards,
    Dejan

  • Hi Reskyllr,

    Which features of SoftDevice Controller have you tried to disable? What was the result? How big improvement did you get on the initial overflow of 20308 bytes?

    Best regards,
    Dejan


  • Hi,dejans,

    It's my hci_ipc.conf.

    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_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

    now log:

    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 3604 bytes.

    For Le audio BIS,I don't know what improvements could be made, that's what I want to know.

    Best regards,

    Reskyllr.

Reply
  • Hi,dejans,

    It's my hci_ipc.conf.

    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_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

    now log:

    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 3604 bytes.

    For Le audio BIS,I don't know what improvements could be made, that's what I want to know.

    Best regards,

    Reskyllr.

Children
  • Hi Reskyllr,

    Can you check if 3 options shown below are set to 'n' in your output files?
    # CONFIG_BT_ISO_CENTRAL=y
    # CONFIG_BT_ISO_BROADCASTER=y
    # CONFIG_BT_ISO_SYNC_RECEIVER=y

    Best regards,
    Dejan

  • Hi,dejans,

    I've tried this, I've set:

    CONFIG_BT_ISO_CENTRAL=n,this is already the result after setting.
    For:
    CONFIG_BT_ISO_BROADCASTER=y
    CONFIG_BT_ISO_SYNC_RECEIVER=y
    If I set either to n, I can't synchronize with bis gateway.

    For Le audio, are there any other options that can be turned off?

    Best regards,

    Reskyllr

  • Hi Reskyllr,

    Can you please confirm that you tried to do DFU on external flash? 

    Can you confirm that you tried to do simultaneous update of both cores?

    We would need to examine configuration options based on the list of features that you intend to use in your application. Could you please specify all the features which you plan to use?

    Best regards,
    Dejan

  • Hi  ,

    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.

     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

    Thanks,

    Ahmd

  • 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


Related