nRF Connect SDK v2.3.0 Migration RAM Overflow

I am in the process of migrating from nRF Connect SDK v2.0.0 to v2.4.0. In order to isolate some of the compile errors, I did this incrementally, and found that in v2.3.0 specifically, I was getting a RAM overflow error during compilation:

/opt/nordic/ncs/toolchains/4ef6631da0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `noinit' will not fit in region `RAM'
/opt/nordic/ncs/toolchains/4ef6631da0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `RAM' overflowed by 7012 bytes

The only thing I've found to allow for successful compilation is changing the following symbols in hci_rpmsg.conf from 251 to 179:

CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_BUF_ACL_RX_SIZE=251

In looking through the map file, I tried reducing the sizes of other memory areas (e.g. memory slabs) that account for far more than 7000 bytes, but they resulted in the exact same error as above. This is occurring in two projects: a Peripheral UART and Central UART. Both use SoftDevice, and both projects get the exact same error message (including the specific byte amount) at compilation. The two projects are quite different. Lastly, the error messages I see locally have been reproduced in a CI environment, so I don't think I have anything weird going on with my SDK setup that a fresh install would remedy.

I would prefer to keep these BT buffers their original size; where else can I look to reduce the size of the noinit section? Why do these buffers seem to be the only thing that changes the overflow amount?

Thanks!

Parents
  • I dug into this more, and now understand this specifically applies to the network core child image; I can see in the correct map file where the overflow is. The configs I specified in the first post are the only ones in my hci_rpmsg.conf file. Given that, are those buffer sizes supported for the nRF340 using SoftDevice on SDK v2.3.0? Is there anything in prj.conf that would influence this? And is there anything I can do to avoid reducing these buffer sizes?

    Thanks for reading

  • To anyone stuck on this issue, I found that setting a maximum allowable bluetooth connections (CONFIG_BT_MAX_CONN) allowed me to compile. I didn't have this config in my hci_rpmsg.conf, and it defaults to16 which is much more than I needed. Looks like the Nordic SoftDevice RAM consumption grew enough to push the child image over the limit.

    Hope this helps someone

Reply Children
No Data
Related