This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Multirole example's memory footprint

Hi, We are working with NRF 51822 in a multi-role arrangement (SDK 12.3.0, s130_nrf51_2.0.1_softdevice) where one NRF51 will be connected to a phone in peripheral mode and will work as central to 7 other NRF51s. All the data exchange is over NUS.

We want to optimise memory usage by basic components as our application needs a lot of RAM. The multi-role examples (both lesc and relay) seem to use > 4500 bytes of RAM. Here is a brief analysis of the top users (> 100 bytes) of .bss section :

_build/nrf51822_xxac_nrf_log_frontend.c.o 1048

_build/nrf51822_xxac_peer_database.c.o 821

_build/nrf51822_xxac_ble_advertising.c.o 454

_build/nrf51822_xxac_main.c.o 355

_build/nrf51822_xxac_fds.c.o 308

_build/nrf51822_xxac_nrf_log_backend_serial.c.o 259

_build/nrf51822_xxac_ble_hrs_c.c.o 168

_build/nrf51822_xxac_bsp.c.o 127

_build/nrf51822_xxac_fstorage.c.o 106

_build/nrf51822_xxac_id_manager.c.o 104

We can eliminate the logging related usage, but I wanted to ask if there is any way to reduce memory consumed by other modules (e.g. peer DB, advertising etc.). Softdevice is already allocated ~14kB memory as per values in app_ram_base.h file.

Also, in our application code, I have made central sec count 0 and reduced GATTS attribute table size to lowest possible. Can there be any other optimisations?

Any help/pointers welcome. Thanks,

  • Amit
Related