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
  • "Right now I'm trying to make it advertise rather than act as a beacon."

    That doesnt make any sense.

    All BLE application have to advertise, otherwise no other device knows of their existence and hence can't connect.

    If you are saying you want it to advertise differently, e.g. has services etc etc, then I'd recommend you use the ble_app_template instead of the ble_app_beacon example

    If you want continue modifying the beacon example, I'd advise you go back to a clean unmodified version of the beacon and then make your changes one by one, and each time test whether the code is still working afterwards. So that you can isolate precisely which change broke the application

Reply
  • "Right now I'm trying to make it advertise rather than act as a beacon."

    That doesnt make any sense.

    All BLE application have to advertise, otherwise no other device knows of their existence and hence can't connect.

    If you are saying you want it to advertise differently, e.g. has services etc etc, then I'd recommend you use the ble_app_template instead of the ble_app_beacon example

    If you want continue modifying the beacon example, I'd advise you go back to a clean unmodified version of the beacon and then make your changes one by one, and each time test whether the code is still working afterwards. So that you can isolate precisely which change broke the application

Children
No Data
Related