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

Estimate s132 memory usage

I am trying to estimate the memory usage of the s132 v3.0.0 running on a nRF52832. I am interested on acting only as a peripheral with one link at a time only. From app_ram_base.h, I get that:

#define APP_RAM_BASE_CENTRAL_LINKS_0_PERIPH_LINKS_1_SEC_COUNT_0_MID_BW 0x20001fe8

So I understand that the softdevice will use 8168 bytes. Also, when I call softdevice_enable I configure it with a given attr_tab_size so I can fit all my services an my characteristics there.

My question is: is the softdevice using 8168 + attr_tab_size bytes? Is there any other way to estimate the memory consumption of the softdevice?

  • Hi Genis,

    App RAM base 0x20001fe8 (8168 bytes) are already included SOFTDEVICE_GATTS_ATTR_TAB_SIZE = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT = 0x580 bytes. This is the input param when you call softdevice_enable()

    It should fit quite a lot of your service and characterstics. But if you receive NRF_ERROR_NO_MEM when declaring new characteristic or service, you can think of increasing the value of the SOFTDEVICE_GATTS_ATTR_TAB_SIZE when you assign it to p_ble_enable_params->gatts_enable_params.attr_tab_size before calling softdevice_enable().

    This will require more RAM for the softdevice and you need to modify the start RAM1 in Keil project setting accordingly.

Related