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

ble_peripheral/ble_app_beacon modification, error 0x12

Using Segger Embedded Studio 310i in Linux and SDK12.2.0, I imported the Beacon example project (ble_peripheral/ble_app_beacon) from Keil. Right now I'm trying to make it advertise rather than act as a beacon. I removed what I thought to be unnecessary for this. Here is main.c now: bpaste.net/.../e839e61fa3ea

All the declarations of a variable a are just so that I can set a breakpoint. My problem is that there is no advertising and the LED doesn't blink. When debugging, it clearly crashes in advertising_start. In the breakpoint at line 101, I see that I have err_code = 0x12 = 18:

#define  NRF_ERROR_CONN_COUNT   (NRF_ERROR_BASE_NUM + 18)
  Maximum connection count exceeded. 

I don't understand why I get this error, even before it starts advertising.

I also tried to set PERIPHERAL_LINK_COUNT and CENTRAL_LINK_COUNT both to 1. Is a link a connection? - Then the error does make sense. However, it then crashes at the call to softdevice_enable_get_default_config, it seems. In the comments (line 33 and 34), it says that "When changing this number remember to adjust the RAM settings". But I'm not sure what is meant by that.

Parents
  • Hi,

    You are doing BLE_GAP_ADV_TYPE_ADV_IND advertising (Connectable undirected), you therefore need to set PERIPHERAL_LINK_COUNT 1, or else you will get the NRF_ERROR_CONN_COUNT error. CENTRAL_LINK_COUNT should be 0. But as Roger Clark recommend, the beacon example does not show you how to set up a connection to a central, and you will save yourself from a lot of work if you start from scratch with e.g. ble_app_uart or ble_app_template example project. (Example that is actually set-up to act as a peripheral with a connection to a central.).

Reply
  • Hi,

    You are doing BLE_GAP_ADV_TYPE_ADV_IND advertising (Connectable undirected), you therefore need to set PERIPHERAL_LINK_COUNT 1, or else you will get the NRF_ERROR_CONN_COUNT error. CENTRAL_LINK_COUNT should be 0. But as Roger Clark recommend, the beacon example does not show you how to set up a connection to a central, and you will save yourself from a lot of work if you start from scratch with e.g. ble_app_uart or ble_app_template example project. (Example that is actually set-up to act as a peripheral with a connection to a central.).

Children
No Data
Related