Page 1 of 1

nrf51-dk compile error

Posted: 14:28, 24 Jun 2015
by RichardF
Hi all,

Richard is the name, playing with hardware is my game :-)

got an nrf51-dk board, and tried the tutorial on how to turn this board into a discoverable beacon through mbed,
followed all the steps mentioned in the tut, but when trying to compile, I am getting an error that BLEDevice.h could
not be found, is there some additional action needed? Please help me, this is very interesting stuff.


Re: nrf51-dk compile error

Posted: 18:36, 04 Jul 2015
by Amman
I have been working with Arduinos and as you described it seems
the BLEDevice.h is completely missing from your folder structure or misplaced.

As an example:

Code: Select all

   -->Libraries  folder
       --> NRF51-DK folder
            => examples folder  (contains other example subfolders  and .ino)
            => BLEDevice.h

If that helps.

Re: nrf51-dk compile error

Posted: 22:55, 08 Jul 2015
by ardiri
did you include the BLE libraries within the mbed compiler?

you may also want to take a look at the following post; there are some changes made to the API's which make the examples break.


Re: nrf51-dk compile error

Posted: 01:45, 09 Jul 2015
by ardiri
here is a patch to apply against the original source code that was available in the blog post ... sing-mbed/

as i mention in the other thread; ARM has changed the SDK slightly and BLEDevice.h has been renamed to BLE.h. i will be updating the zip file we have on the blog post and we will also need to reflect this as an update to our examples in the evothings studio download. for now; you will need to apply the patch yourself.

Code: Select all

$ diff -ruN main.cpp.orig main.cpp
--- main.cpp.orig   2015-07-09 08:42:00.000000000 +0800
+++ main.cpp   2015-07-09 08:43:19.000000000 +0800
@@ -6,7 +6,7 @@
 #define CONSOLE_LOG
 #include "mbed.h"
-#include "BLEDevice.h"
+#include "BLE.h"
@@ -116,10 +116,7 @@
-void onConnection(Gap::Handle_t handle,
-                  Gap::addr_type_t peerAddrType,
-                  const Gap::address_t peerAddr,
-                  const Gap::ConnectionParams_t * connectionParams)
+void onConnection(const Gap::ConnectionCallbackParams_t *params)
   INFO_NL(">> connected");
@@ -128,10 +125,10 @@
   onLedDataWritten(&led_value, 1); // force LED's to be in off state
-void onDataWritten(const GattCharacteristicWriteCBParams *context)
+void onDataWritten(const GattWriteCallbackParams *context)
   // was the characteristic being written to nRF51_GATT_CHAR_LED?
-  if (context -> charHandle ==
+  if (context -> handle ==
       gatt_characteristics[CHARACTERISTIC_LED] -> getValueHandle())
     onLedDataWritten(context -> data, context -> len);

Re: nrf51-dk compile error

Posted: 12:07, 20 Jul 2015
by RichardF
Back from holiday, tried the patch, and indeed, it is working now.

thanx !

Re: nrf51-dk compile error

Posted: 01:06, 21 Jul 2015
by ardiri
great - i have since updated the blog post and asked the boys to update the examples repository.