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

nRF52832 NRF_ERROR_NO_MEM on long write characteristic add

Hi,

I'm trying to deal with long write events (37 bytes long) but on adding a second long write characteristic I'm facing the NRF_ERROR_NO_MEM error on adding it.

The second characteristic is a copy, with different UUID, from the characteristic that is working.

I tried to change the NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE and RAM memory allocation without any success.

Is there any other value that I need to change to increase RAM memory on SoftDevice?

Thanks in advanced!!

Regards,

Pedro

Parents Reply
  • Well increasing the GATTS ATTR TAB SIZE in the softdevice would require more RAM space for softdevice to accommodate the increased attributes. This would push away (increase) the start of the RAM where the application can begin with.

    You need to querry the RAM start of the application that softdevice assumes using below code before enabling the softdevice.

        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Register a handler for BLE events.
        NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);

    The Linker macros should also match with this value by editing RAM_START as shown below

    I see no other reason why else the characteristic add would fail.

    /Susheel

Children
No Data
Related