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

Beacon and GATT: NRF_ERROR_NO_MEM

HI guys,

I am running a beacon based on the ble_app_beacon example. This works fine.

Next, I made a connectable GAP/GATT application to read and make some settings. This is based on the ble_app_hrs example, and also works fine.

Finally, I wanted to combine these two: run the beacon until a button is pressed, and then start GAP/GATT. However, if any beacon has been transmitted before the initialization of the GAP/GATT it fails: ble_advertising_init returns error code 4 = NRF_ERROR_NO_MEM. If no beacon has been sent before, initialization succeeds and the device starts fast advertising.

I traced the code as far as the sd_ble_gap_adv_set_configure() call in ble_advertising.c, but this is a SD call and canniot be debugged.

I tried increasing stack size and heap, but to no avail. Is there a way to check what is causing the NRF_ERROR_NO_MEM error?

Are there any examples of the combination Beacon and Connectable device?

Thanks for your help,

Henk

Parents Reply
  • Hi Simon,

    still no luck with this problem.

    I struggle with the different calls to ble_advertising_init. The beacon  example uses "ble_gap_adv_params_t" and calls sd_ble_gap_adv_set_configure() to initialize the advertizing. The HRS example uses macro BLE_ADVERTISING_DEF to declare a "ble_advertising_t" structure that incorporates the  "ble_gap_adv_params_t" and calls ble_advertising_init().

    I tried to have both functions use the same data structure, but whatever I try the call to ble_advertising_init() returns either a NRF_ERROR_NO_MEM or a NRF_ERROR_INVALID_PARAM.

    Do you know of any complete and runnable example code that shows how to do this? The example you mentioned does not show how to declare the various structures.

    thanks for you help,

    Henk

Children
No Data
Related