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

Pairing/bonding with ble_app_template example not working for me

Hi,

I just recently got into designing Bluetooth devices and I am experimenting with NRF51822 and BLE400 board. I managed to compile and upload the examples from SDK 11.0.0 to the device with SEGGER Embedded Studio and I can advertise and connect to the device with nRF Connect app on my Android phone.

When I try to bond with nRF Connect it just hangs up after a couple of seconds. A similar thing happens if I try to pair with the phone directly.

Is there something I have to implement in the code of the example app?

  • I managed to enable the logs and I got NRF_ERROR_INTERNAL I also tracked the PM_EVT_ERROR_UNEXPECTED and it gets called by SM_EVT_ERROR_UNEXPECTED on line 300 in peer_manager.c

    I will look at the tutorials maybe I will find something useful. To set up the project I just opened the GitHub project that I mentioned before. That worked out of the box. Then I imported the project from examples to SEGGER Studio and changed the .emProject file to resemble the file from GitHub project. I think that I might have missed out some detail in that process that may have caused this behavior.

  • Have you solved the issue? If not, what memory setting are you using? Have you been able to do a sniffer trace?

  • Hi, unfortunately no. I didn't have that much time although. After not being able to make it work with the template from github I decided to follow the tutorial for Segger Studio from this page. But I get two leds that are always on and not one blinking like it would be if device was advertising. I don't know exactly why that would be as the precompiled hex file that comes with the SDK works. Is there something that you have to set up in the environment for specific board or no? The github project has a file for ble400 pins but I don't know how would the precompiled hex file then work out of the box.

  • I had a similar problem with the ble_app_bms example.

    My first pairing (with my smartphone) worked.  After unpairing and trying to reconnect, I would get PM_EVT_ERROR_UNEXPECTED.

    In another answer, Hung Bui advised setting allow_repairing = true in the call to pm_conn_sec_config_reply().  That fixed it for me.

Related