1

Essentially, I'm trying to figure out how I can use Bluetooth Classic using the on-board U-blox w102 Wifi/Bluetooth module. I'm assuming that SerialNina and SerialHCI are somehow connected to it and maybe the way to use Bluetooth Classic on the Nano RP2040.

The ArduinoBLE library uses SerialHCI in HCIUartTransport.cpp. It also messes with NINA_RESETN and SPIWIFI_SS a bit in BLELocalDevice.cpp, but I'm not too worried about those.

The WiFiNINA library uses SerialNina to update the wifi firmware in SerialNINAPassthrough.ino and ESP32BootROM.cpp.

From this, I'm assuming that SerialHCI can be used to control BLE and SerialNina updates the Wifi's firmware. Am I right about this? If so, what part of the Nina-w102 module is SerialHCI connected to?

1 Answer 1

0

what part of the Nina-w102 module is SerialHCI connected to?

from ArduinoCore-mbed/variants/NANO_RP2040_CONNECT/pins_arduino.h

#define SerialNina      Serial3
#define SerialHCI       Serial2
#define SERIAL2_TX          (digitalPinToPinName(25))
#define SERIAL2_RX          (digitalPinToPinName(26))
#define SERIAL2_CTS         (digitalPinToPinName(27))
#define SERIAL2_RTS         (digitalPinToPinName(28))
#define SERIAL3_TX          (digitalPinToPinName(25))
#define SERIAL3_RX          (digitalPinToPinName(26))

Serial2 is configured with flow control pins, but both Serial2 and Serial3 use the same RX/TX pins wired to ESP32 NINA RX/TX.


the way to use Bluetooth Classic on the Nano RP2040:

To use classic Bluetooth on Arduino boards with esp32 NINA module you have to replace the Arduino nina-fw in the esp32 with the SerialToSerialBT.ino sketch for esp32 Arduino core.

You can flash NINA over the host MCU (rp2040) with SerialNINAPassthrough.ino sketch of WifiNINA library. More details about that are in this Arduino forum thread. (Ignore the part before my first comment there).

But with this modification there is no nina firmware, so no WiFi, no cloud. The esp32 is then like a HC-05.

4
  • Yeah I went through that thread a few times before and it seems it only worked for people with certain boards. I uploaded SerialNINAPassthrough.ino to my RP2040 without any errors. Then I attempt to upload SerialToSerialBT.ino to my RP2040 as the esp32 u-blox NINA-w102 with an upload speed of 115200. I get the error "serial.serialutil.SerialException: could not open port 'COM3': WindowsError(5, 'Access is denied.') Failed to execute script esptool the selected serial port Failed to execute script esptool does not exist or your board is not connected." The builtin led flashes a bunch of times.
    – Rojo
    Aug 19, 2021 at 14:06
  • "Access is denied"? do you have the Serial Monitor open?
    – Juraj
    Aug 19, 2021 at 14:13
  • I closed the Serial Monitor and retried it. Now I'm getting the error "serial.serialutil.SerialTimeoutException: Write timeout Failed to execute script esptool An error occurred while uploading the sketch." I'm following the same steps I listed above. Also, the builtin led doesn't flash this time.
    – Rojo
    Aug 19, 2021 at 15:50
  • maybe try the upload with esptool from command line and disable the reset before upload with -before no_reset
    – Juraj
    Aug 19, 2021 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.