C:\Users\hk\AppData\Local\Temp\arduino_build_501413\libraries\ArduinoBLE-1.2.2\utility\HCICordioTransport.cpp.o: In function `HCICordioTransportClass::end()':
C:\Users\hk\Documents\Arduino\libraries\ArduinoBLE-1.2.2\src\utility/HCICordioTransport.cpp:237: undefined reference to `ble::CordioHCIDriver::terminate()’
C:\Users\hk\AppData\Local\Temp\arduino_build_501413\libraries\ArduinoBLE-1.2.2\utility\HCICordioTransport.cpp.o: In function `HCICordioTransportClass::begin()':
C:\Users\hk\Documents\Arduino\libraries\ArduinoBLE-1.2.2\src\utility/HCICordioTransport.cpp:215: undefined reference to `ble::CordioHCIDriver::initialize()’
C:\Users\hk\Documents\Arduino\libraries\ArduinoBLE-1.2.2\src\utility/HCICordioTransport.cpp:69: undefined reference to `ble::CordioHCITransportDriver::set_data_received_handler(void ()(unsigned char, unsigned char))’
collect2.exe: error: ld returned 1 exit status
Try wiping the folder(s) like so https://support.arduino.cc/hc/en-us/art … rduino-IDE and see if a re-install helps
i have reinstalled the arduino ide on another pc.
Unfortunately this has brought no success!
With the Nano BLE the compiler and linker works perfectly.
So I tried C:\Users\hk\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.1.1\variants\ARDUINO_NANO33BLE replaced by the files from the nrf52840.This seems to work with the weather shield.I hope that the compilere parameters in the next version will be adjusted
Translated with www.DeepL.com/Translator (free version)
It seems the problem is related to the pre-compiled MBED library. This is stored in variants/XXXnrf52480xxxx/libs/libmbed.a. Pre-compiling saves compile time for the sketch, it just links
Apparently, the Arduino header files use a new/different namespace than the compiled version of Sparkfun. I have run into compatibility issues before. It would be MUCH better for Sparkfun to provide a complete library instead of a copy and add-in.
A have tried versions 2.80, 3.0.1 and 3.1.1 of the Arduino library. They all fail with the same error message. More testing planned.
You can use the Arduino NANO BLE library, but I am not sure the pins/pads are the same for the Sparkfun nrf52480
The problem is indeed related to namespace changes between Mbed version 5.x and version 6.x.
In Mbed 5 it used to be : ble::vendor::cordio::CordioHCIDriver::terminate()
In Mbed 6 it is : ble::CordioHCIDriver::terminate()
These changes have NOT been applied by Sparkfun in the compiled libmbed.a that is part of the variant. I will post that on github as an error.
short term workaround
If you want to compile for an NRF52480 there is a way around it by changing 3 header files ( 2 that are part of Mbed and 1 that is part of ArduinoBLE). BUT after making these changes a compile for the Nano BLE will fail unless you undo the changes !!
In the files MBED header files :
cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/driverCordioHCIDriver.h
cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/driverCordioHCITransportDriver.h
EXTEND in the top the name space definition to
namespace ble {
namespace vendor { // added
namespace cordio { // added
and extend at the bottom
} // namespace cordio (added)
} // namespace vendor (added)
} // namespace ble
In the file
/Arduino/libraries/ArduinoBLE/src/utility/HCICordioTransport.cpp
CHANGE
#if (MBED_VERSION > MBED_ENCODE_VERSION(6, 2, 0))
#define BLE_NAMESPACE ble
#else
#define BLE_NAMESPACE ble::vendor::cordio
#endif
COMMENT out the 4 lines to keep only the last #define
//#if (MBED_VERSION > MBED_ENCODE_VERSION(6, 2, 0))
//#define BLE_NAMESPACE ble
//#else
#define BLE_NAMESPACE ble::vendor::cordio
//#endif
thanks for the good explanation and the effort.many thanks