platformio / platform-nordicnrf51

Nordic nRF51: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/nordicnrf51
Apache License 2.0
20 stars 25 forks source link

BLE library is broken for nrf51xx #8

Closed vkolotov closed 6 years ago

vkolotov commented 7 years ago

A simple program fails to compile (Red Bear BleNano):

#include "mbed.h"
#include "ble/BLE.h"
#include "DFUService.h"

void main() {
}

I've installed the following library: pio lib install 296

And I'm getting the following errors:

[Thu Jan 12 08:23:46 2017] Processing redBearLabBLENano (platform: nordicnrf51, board: redBearLabBLENano, framework: mbed)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Collected 8 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- <ble> v2.7.0

Compiling .pioenvs/redBearLabBLENano/src/main.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/BLE.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/BLEInstanceBase.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/DiscoveredCharacteristic.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/GapScanningParams.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/services/DFUService.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/services/UARTService.o
Compiling .pioenvs/redBearLabBLENano/lib/ble_ID296/services/URIBeaconConfigService.o
src/main.cpp:3:24: fatal error: DFUService.h: No such file or directory
#include "DFUService.h"
^
compilation terminated.
In file included from .piolibdeps/ble_ID296/source/services/DFUService.cpp:19:0:
.piolibdeps/ble_ID296/ble/services/DFUService.h:26:29: fatal error: dfu_app_handler.h: No such file or directory
#include "dfu_app_handler.h"
^
compilation terminated.
*** [.pioenvs/redBearLabBLENano/src/main.o] Error 1
*** [.pioenvs/redBearLabBLENano/lib/ble_ID296/services/DFUService.o] Error 1
========================== [ERROR] Took 3.72 seconds ==========================

OS: MacOS Sierra 10.12.1 IDE: 1.7.1 Core: 3.2.1

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40857370-ble-library-is-broken-for-nrf51xx?utm_campaign=plugin&utm_content=tracker%2F38217987&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38217987&utm_medium=issues&utm_source=github).
matoushybl commented 7 years ago

I can confirm this issue, same happens to me when building for Nordic DK.

wonderfulsuccess commented 7 years ago

@matoushybl Do you know how to solve this problem, I mean how to use mbed BLE API in platformio. Thanks a lot. 8 )

matoushybl commented 7 years ago

I finally had some time to look into this problem and it seems that the build is broken for MacOS, I tried building on windows and there seemed to be no problem with it. Hopefully this could help a bit with looking for the problem.

pbochenski commented 7 years ago

looks like .piolibdeps/nrf51-sdk_ID328/source/nordic_sdk/components/libraries/bootloader_dfu folder lacks of experimental sources. see mbed online compiler: http://imgur.com/a/73qkd unfortunatelly coping those files there does not fix the problem.

surdu commented 7 years ago

Any updates on this? It is till not working.

ivanmartinvalle commented 6 years ago

If it helps anyone, it didn't work for me until I added lib_deps = ble-nrf51822 into my platformio.ini file. I would have thought that pio lib install ble-nrf51822 would do this for me, but it didn't.

ivankravets commented 6 years ago

Fixed in the latest release