I am trying to use RP2040 board with ArduinoBLE-library. This lib accesses HCIUartTransport, giving error
.pio\libdeps\nanorp2040connect\ArduinoBLE\src\utility\HCIUartTransport.cpp:33:2: error: #error "Unsupported board selected!"
33 | #error "Unsupported board selected!"
| ^~~~~
*** [.pio\build\nanorp2040connect\libd5f\ArduinoBLE\utility\HCIUartTransport.cpp.o] Error 1
Looking at the code in that file:
#if !defined(ARDUINO_ARCH_MBED) || defined(TARGET_NANO_RP2040_CONNECT)
#include "HCIUartTransport.h"
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
#define SerialHCI Serial2
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
// SerialHCI is already defined in the variant
#elif defined(ARDUINO_PORTENTA_H7_M4)
// SerialHCI is already defined in the variant
#elif defined(ARDUINO_PORTENTA_H7_M7)
#define SerialHCI Serial2
#else
#error "Unsupported board selected!"
#endif
I added the following build flags to platform.ini:
build_flags = -DTARGET_NANO_RP2040_CONNECT
-DARDUINO_NANO_RP2040_CONNECT
But it still gives the same error.
This is related to my previous
question: Arduino Nano RP2040 Connect, blinking RGB led does not compile - #4 by maxgerhardt
What is wrong in my build-flags ?