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

SPI communication and BLE advertising data with nRF52 DK

Hi everyone!

I have already developed a couple projects in nRF52 DK and the result was quite messy. I want to make it right this time and that's why I am requesting your help.

I am using nRF52 DK and SDK 13.0.0. and Eclipse Mars 2 (C/C++) with the setup explained in this Devzone Tutorial.
My goal is to create a project starting from some examples, modifying and merging them. I intend to comunicate with a SPI peripheral and send the recieved data through BLE advertising mode (broadcast).

I have compiled and tested the SPI example and it works just fine. Now, I need to send that data over BLE advertising. The requirement is it to be sent at least 10 times every second.

I would be very grateful if you could guide me on this. Some pages that I should read, any example that broadcasts data over BLE, any question already answered on this topic (I have searched and I did not find that much), any help will be very welcome. I really want to learn how to use Nordic hardware but my previous experience has only been frustrating so far.

Thank you so much for your time!

AGB

Parents
  • I have compiled and uploaded the "ble_app_beacon" example in the Nordic nRF52 DK and it seemed to work fine, but then, I changed some data in the beacon to check if the changes had effect and they did not.

    After the changes, I obviously saved, cleaned the project, compiled again and uploaded the new file to the board. I also refreshed the app, restarted the board,... I changed the "major" and "minor" fields, but it keeps displaying the default ones.

    Does anyone know why is this happening?

    I do not post the code here because is the original one, the only change was "major" and "minor" fields.

    PS: I also tried changing the company field, the UUID,... nothing changes in the advertising packet.

  • Hi Ander,

    for changing major and minor value change the following #define in main.c

    #define APP_MAJOR_VALUE 0x01,0x02 /**< Major value used to identify Beacons. */
    #define APP_MINOR_VALUE 0x03, 0x04 /**< Minor value used to identify Beacons. */

    same for all the values which u need to change. UUID and company field.

  • Thank you for your early reply. That's what I tried, but it did change nothing in the advertising packet. I found the issue, instead of linking the main.c file of my local repository folder I linked to the project the main.c file of the examples folder by mistake. Sorry for the trouble.

    If I want to programatically change one BLE field to send the data from my SPi sensor, what field would you advise me to use?

  • It depends upon your sensor value.. You can use any field from advertisement packet e.g major number.

Reply Children
No Data
Related