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

Are there any differences between SDK15 and SDK17 in configuring Custom Services?

Hi,

I'm trying to add a custom service to a working application that has a working battery service.

I have followed https://github.com/NordicPlayground/nRF52-Bluetooth-Course

I'm using SDK17.0.2 but does that make any difference in the way you should set up a Custom Service compared to SDK15?

  • Hi Jerker, 

    I don't think there is a big difference between SDK v15 and SDK v17 with regard to the customer service. 

    My suggestion is that you can go through the Course with SDK v15. Just to make sure all the steps work as they should. 

    After that you can start your development on SDK v17. It should be very very similar if not identical. 

    One good source of reference when you work on SDK v17 is to have a look at the ble_app_uart where we define and use a custom service called NUS. You can use that as an example. 

  • Hi Bui,

    I installed nRF5_SDK_15.3.0_59ac345 and after going over the steps in the course I got the FW running on my nRF52840-DK. (And I'm using s140).

    The device is visible if I look at my phone but I cannot connect to it, and nor can I bond to it, The first time I try to bond with it the debugger stops like in the attached snapshot:

    No error codes are printed what I can see.

  • Hi Jerker, 

    Please follow the debugging guide here.

    When you step inside the code that uses the softdevice, it will crash if the softdevice is active. The reason is that when we stop at a breakpoint the RTC timing is still running and if we continue to step in the code it will crash. 

    I would suggest to get familiar with other ble example in the SDK and you can try to debug and catch different events, for example BLE_GAP_EVT_CONNECTED. It's when the device get connected. 

    Please try to test with SDK v15.0.0 instead of SDK v15.3 as it's the exact version used in the course. 

  • Hi Bui,

    Yes, I'm following the debugging guide and I have tested a number of the examples in particular the ones concerning ble and yes, I understand that when debugging the code might crash if you continue to single step after a break point. You run the code from a restart to the break point where you can check your registers and variables etc with minimum impact to the integrety of the data you want to look at.

    But what was happening was not that I had any break point set, but rather that the the code frooze in the middle of some binary code when I tried to bond or connect, and that is a bit puzzeling.

    How ever, I have already tried with nRF5_SDK_15.0.0_a53641a but still not successful.

    I follow your suggestion and set a break point at BLE_GAP_EVT_CONNECTED and see if I can understand what goes wrong.

    Thx

    J

  • The course was a bit old and the person who created the course has left us so I don't have much experience with the code. 

    Please check and make sure the ble_app_template works for you. You may want to test by disable the calls that initialize the service/characteristic that you added. Adding a service/characteristic shouldn't really affect how the device react when get connected. 

    Be careful when you do bonding, try to test without any bonding and try to erase the chip before testing, just in case there's some previous bonding information left. 

Related