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

Making a BLE iBeacon with GAP & GATT profiles on N52832 (nRF52-Development Kit)

I am trying to use the nRF52-Development kit with (N52832) and using nRF5_SDK_15.0.0. What my application is to broadcast an iBeacon Packet (with Major, Minor, RSSI and UUID) while also having a few GAP and GATT services.

I have tried the "ble_app_beacon" and am able to throw out an iBeacon packet but I am having difficulty in adding GAP and GATT profiles on it.

It would be greatly appreciated if a stepping stone be provided for this.

Regards.

Edit 1:
I have found a tutorial that shows how to introduce Services using this tutorial:
https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

followed by:

https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

using SDK 15.0.0. What I need is implementing on how to add the iBeacon along with the usual services?

Edit 2:

I found this resource which uses iBeacon packet and UART connectable packet:
https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/concurrent-advertising

Edit 3:

This is another question similar to mine. I followed the steps in the thread but still gave an error when debugging it at

Question Link: https://devzone.nordicsemi.com/f/nordic-q-a/33945/connectable-beacon

Code getting error at:

    err_code = nrf_sdh_ble_enable(&ram_start);
    APP_ERROR_CHECK(err_code);

I believe the above statement gives an err_code = 4


What I want to achieve is:
1) Connectable iBeacon packets 
2) Custom GAP services to be included in it.

Parents
  • I am not sure if I understand you correctly. What do you mean by adding GAP and GATT profiles to the iBeacon packet?

    The GAP profile is a layer of BLE that is responsible for connecting two or more BLE devices, which includes scanning, advertising and link establishment. Broadcasting an iBeacon packet (advertising) is controlled by the GAP layer.

    However, inclusion of services and characteristics happens on the GATT layer, and you don't include it in the advertising packet (iBeacon packet). The link you provided (ble characteristics tutorial) explain thoroughly how this works.

    If you would like to put in your custom data into the iBeacon packet, you can use the AD type 0xFF («Manufacturer Specific Data»). Take a look at this thread, where I explain more around the advertising packet.

    If anything is unclear, please tell me, and I will elaborate more.

    Best regards,

    Simon

  • This question asks similar to my query. I followed the steps in the replies but still it gave an error code:
    https://devzone.nordicsemi.com/f/nordic-q-a/33945/connectable-beacon

  • I was able to make it work by following the suggestions in this ticket. I did the following:

    • Opened the example C:\Nordic\SDK\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_beacon_case
    • Enabled RTT logging (Which will make you able to see what to set RAM start and RAM size to)
      • Set NRF_LOG_BACKEND_RTT_ENABLED to 1 in sdk_config.h
      • Set NRF_LOG_ENABLED to 1 in sdk_config.h
    • Inside advertising_init(..) I changed m_adv_params.properties.type from  BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED to  BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED
    • Started a debug session
      • Debug--> Go --> Press green arrow
    • Got the following logging:

    <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
    <warning> nrf_sdh_ble: Change the RAM start location from 0x200018A8 to 0x20001D88.
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0xE278.
    <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    <error> app: Fatal error

    • Changed RAM start and RAM size to respectively 0xE278 and 0x20001D88 by following the steps in https://devzone.nordicsemi.com/f/nordic-q-a/33945/connectable-beacon
      • In the Project Explorer window, right click on "Project 'ble_app_beacon_pca10040_s132'"  an click on Options
      • Remember to choose common
    • Build and flash the example, and it should work

    Best regards,

    Simon

  • I followed your steps and go it working Slight smile

    Also had to change #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT to 1 in sdk_config.h

    Also thank you for the tip on starting the NRF_LOG_ENABLED & NRF_LOG_BACKEND_RTT_ENABLED, helps you see more clearly the steps

    Also I was using SDK_15.3.0 and the steps worked fine with it.

    Kudos Simon 

    Regards,
    Ameer

Reply Children
No Data
Related