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

Error "BLE_API.h: No such file or directory" upon building BLE central test example #37

Closed vorlovsky closed 3 years ago

vorlovsky commented 3 years ago

I've imported BLE_CentralTest example from Arduino and tried to build it for nRF51822 with PlatformIO, but got stuck on "BLE_API.h: No such file or directory" error. I've tried to select Platformio or Arduino as a library manager upon project import, but no luck. Also. there is no such error if to build the same sketch using Arduino IDE.

How can this dependencies be fixed in PlatformIO?

Build task output is the following:

Processing nrf51 (platform: nordicnrf51; board: seeedTinyBLE; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf51/seeedTinyBLE.html
PLATFORM: Nordic nRF51 (6.0.1) > Seeed Tiny BLE
HARDWARE: NRF51822 16MHz, 16KB RAM, 256KB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (blackmagic, jlink, stlink)
PACKAGES:

  • framework-arduinonordicnrf5 1.600.190830 (6.0)
  • tool-sreccat 1.164.0 (1.64)
  • toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    Converting arduino-central-test.ino LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF Modes: Finder ~ chain, Compatibility ~ soft Found 2 compatible libraries Scanning dependencies... No dependencies Building in release mode Compiling .pio\build\nrf51\src\arduino-central-test.ino.cpp.o Compiling .pio\build\nrf51\FrameworkArduinoVariant\variant.cpp.o Compiling .pio\build\nrf51\FrameworkArduino\IPAddress.cpp.o Compiling .pio\build\nrf51\FrameworkArduino\Print.cpp.o E:/nRF51/projects/arduino-central-test/src/arduino-central-test.ino:21:10: fatal error: BLE_API.h: No such file or directory

  • Looking for Archiving .pio\build\nrf51\libFrameworkArduinoVariant.a BLE_API.h dependency? Check our library registry!
  • CLI > platformio lib search "header:BLE_API.h"
  • Web > https://platformio.org/lib/search?query=header:BLE_API.h

  • include

      ^~~~~~~~~~~

    compilation terminated. *** [.pio\build\nrf51\src\arduino-central-test.ino.cpp.o] Error 1 ================================================== [FAILED] Took 2.25 seconds ================================================== The terminal process "C:\Users\LJ.platformio\penv\Scripts\pio.exe 'run'" terminated with exit code: 1.

valeros commented 3 years ago

Hi @vorlovsky ! The example you mentioned is supposed to work with Arduino core from RedBear. This platform only supports the Arduino nRF5 core https://github.com/sandeepmistry/arduino-nRF5

vorlovsky commented 3 years ago

@valeros There is no _BLEAPI.h in sandeepmistry/arduino-nRF5. Well, do you mean I need to use Arduino core from RedBearLab instead of the one provided by default for the nordicnrf51 platform? Is it possible to specify it somehow in platformio.ini? I see it is possible for STM32 (through board_build.core option), but what about nRF5?

valeros commented 3 years ago

Unfortunately, there is no support for the Arduino core from RedBearLab at the moment.

vorlovsky commented 3 years ago

Thanks.