nrf5340 BAP_BROADCAST_SOURCE sample region `RAM' overflowed occur.

Bros, I had updated ncs sdk from v3.1.1 to v3.3.1 today, and when I rebuild an nrf5340 project found that NETAPP ram overflowed, and the error could be represented by build the bap_broadcast_source sample, the netapp only has 64k sram, so that means overflowed by 8k can't be settle by tuning parameter, so how to sovle it

c:/ncs/toolchains/936afb6332/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 `noinit' will not fit in region `RAM'
c:/ncs/toolchains/936afb6332/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `RAM' overflowed by 7796 bytes

  • Thanks for finding that, the hci_ipc got much heavier between those releases with more features compiled in into it now.

    Kconfig 3.1.1 3.3.0
    BT_CTLR_ADV_ISO_SET 1 2
    BT_CTLR_ADV_ISO_STREAM_COUNT 2 4
    BT_CTLR_ISOAL_SOURCES 2 4
    BT_CTLR_ISO_TX_BUFFERS 8 12
    BT_ISO_TX_BUF_COUNT 8 12

    Hence the larger memory needs, we need to disable some unused roles here, if you want the same sizes as v3.1.1 add below to a new file for example , trim_netcore.conf 

    CONFIG_BT_CTLR_ADV_ISO_SET=1
    CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=2
    CONFIG_BT_CTLR_ISOAL_SOURCES=2
    CONFIG_BT_CTLR_ISO_TX_BUFFERS=8
    CONFIG_BT_ISO_TX_BUF_COUNT=8
    CONFIG_BT_BUF_EVT_RX_COUNT=14

    CONFIG_BT_CTLR_SYNC_ISO=n
    CONFIG_BT_CTLR_CENTRAL_ISO=n
    CONFIG_BT_CTLR_PERIPHERAL_ISO=n
    CONFIG_BT_ISO_SYNC_RECEIVER=n
    CONFIG_BT_ISO_CENTRAL=n
    CONFIG_BT_ISO_PERIPHERAL=n

    and do a prestine build

    west build -b nrf5340dk/nrf5340/cpuapp --sysbuild -p always zephyr/samples/bluetooth/bap_broadcast_source/ \
      -- -Dhci_ipc_EXTRA_CONF_FILE=$(pwd)/trim_netcore.conf


    I will report this internally so that this gets attention from the team.

    Thanks for reporting it.

  • On the second thought, it does not seem like the SDK team would change the hci_ipc behavior so that it would fit in nRF53 net core. So I think to have this sample run on nRF53 with SDK versions later than 3.1.0, applications have to optimize netcore image size themselves.

Related