Open arhi opened 3 years ago
if I change the .ini to something like this:
[env:waveshare_ble400]
platform = nordicnrf51
board = waveshare_ble400
framework = arduino
build_flags = -DNRF51_S130 -DENABLE_LOG
lib_deps =
BLEPeripheral
https://github.com/jeanmatthieud/platform-nordicnrf51#gpio-low-accuracy-interrupt
debug_tool = jlink
upload_protocol = jlink
so platform is arduino and your fork is put as library
it looks like it's ignoring your fork as ... well it's failing to find attachInterruptLowAccuracy:
> Executing task in folder nrf51822-low-power-sensor: C:\Users\a\.platformio\penv\Scripts\platformio.exe debug <
Processing waveshare_ble400 (platform: nordicnrf51; board: waveshare_ble400; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf51/waveshare_ble400.html
PLATFORM: Nordic nRF51 (7.0.0) > Waveshare BLE400
HARDWARE: NRF51822 32MHz, 32KB RAM, 256KB Flash
DEBUG: Current (jlink) External (blackmagic, jlink, stlink)
PACKAGES:
- framework-arduinonordicnrf5 1.700.201209 (7.0)
- tool-sreccat 1.164.0 (1.64)
- toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Library Manager: Installing BLEPeripheral
Library Manager: BLEPeripheral @ 0.4.0 has been installed!
Library Manager: Installing git+https://github.com/jeanmatthieud/platform-nordicnrf51#gpio-low-accuracy-interrupt
git version 2.31.1.windows.1
Cloning into 'C:\Users\a\.platformio\.cache\tmp\pkg-installing-5w08j2ic'...
Submodule 'builder/frameworks/arduino' (https://github.com/platformio/builder-framework-arduino-nrf5.git) registered for path 'builder/frameworks/arduino'
Cloning into 'C:/Users/a/.platformio/.cache/tmp/pkg-installing-5w08j2ic/builder/frameworks/arduino'...
Submodule path 'builder/frameworks/arduino': checked out '47248c6462b5891b515f1720af1bb309ae195637'
Library Manager: platform-nordicnrf51 @ 0.0.0+20210506232019.sha.bcb50d5 has been installed!
Found 4 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <BLEPeripheral> 0.4.0
| |-- <SPI> 1.0
|-- <platform-nordicnrf51> 0.0.0+20210506232019.sha.bcb50d5
| |-- <BLEPeripheral> 0.4.0
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
|-- <SPI> 1.0
Building in debug mode
Compiling .pio\build\waveshare_ble400\src\main.cpp.o
Compiling .pio\build\waveshare_ble400\libe6e\SPI\SPI.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEAttribute.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEBondStore.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLECentral.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLECharacteristic.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEConstantCharacteristic.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEDescriptor.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEDevice.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEFixedLengthCharacteristic.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEHID.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEHIDPeripheral.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEHIDReportMapCharacteristic.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEHIDReportReferenceDescriptor.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEKeyboard.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLELocalAttribute.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEMouse.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEMultimedia.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEPeripheral.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEProgmemConstantCharacteristic.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLERemoteAttribute.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLERemoteCharacteristic.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLERemoteService.cpp.o
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLEService.cpp.o
src\main.cpp: In function 'void gpio_init()':
src\main.cpp:45:3: error: 'attachInterruptLowAccuracy' was not declared in this scope
attachInterruptLowAccuracy(digitalPinToInterrupt(PIN_SW_SENSOR), sensorValueChanged, FALLING);
^~~~~~~~~~~~~~~~~~~~~~~~~~
src\main.cpp:45:3: note: suggested alternative: 'attachInterrupt'
attachInterruptLowAccuracy(digitalPinToInterrupt(PIN_SW_SENSOR), sensorValueChanged, FALLING);
^~~~~~~~~~~~~~~~~~~~~~~~~~
attachInterrupt
Compiling .pio\build\waveshare_ble400\lib7de\BLEPeripheral\BLESystemControl.cpp.o
*** [.pio\build\waveshare_ble400\src\main.cpp.o] Error 1
In file included from .pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEPeripheral.h:7:0,
from .pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEPeripheral.cpp:9:
C:\Users\arhimed\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/Arduino.h:76:0: warning: "min" redefined
#define min(a,b) ((a)<(b)?(a):(b))
In file included from .pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEPeripheral.cpp:6:0:
.pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEDeviceLimits.h:16:0: note: this is the location of the previous definition
#define min(a,b) (((a) < (b)) ? (a) : (b))
In file included from .pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEPeripheral.h:7:0,
from .pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEPeripheral.cpp:9:
C:\Users\arhimed\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/Arduino.h:77:0: warning: "max" redefined
#define max(a,b) ((a)>(b)?(a):(b))
In file included from .pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEPeripheral.cpp:6:0:
.pio\libdeps\waveshare_ble400\BLEPeripheral\src\BLEDeviceLimits.h:12:0: note: this is the location of the previous definition
#define max(a,b) (((a) > (b)) ? (a) : (b))
================================================================================================== [FAILED] Took 5.89 seconds ==================================================================================================
The terminal process "C:\Users\a\.platformio\penv\Scripts\platformio.exe 'debug'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I solved it by creating my own fork and adding package.json
Is there a way to find out more about how to solve the problem?
With original .ini:
So the two "platform" options (first is arduino, second is your fork with low accuracy interrupt) fail platformio. Removed the first one (Arduino) and
Any idea how to make this work ?!