0
\$\begingroup\$

I designed and had manufactured a custom version of the Arduino Nano IoT 33 (basically the same, except it has some additional ICs on the PCB). It is working just fine when I program using the Arduino language (e.g. I can get LEDs to light up, PWM output, etc.). The Nina W102 Bluetooth Low Energy module (BLE), however, will not initialize.

I get a failure code returned to me when I run BLE.begin() (the result is 0, meaning a failure code). I used a debugger to follow the stack trace, and found that the exact function where it fails is here (in HCI.cpp in the ArduinoBLE module):

int HCIClass::reset()
{
  return sendCommand(OGF_HOST_CTL << 10 | OCF_RESET);
}

I've reached the limits of my understanding of Arduino and BLE (I'm a little new to this), and don't understand what this code does and whether it's a clue to determine what I have set up wrong.

Some additional comments:

  • I have triple checked my circuit schematics and board design. The schematics reflect nearly exactly the Arduino schematic here. https://store.arduino.cc/usa/nano-33-iot (see "PDF schematic"). I say "nearly" because I did not include the ECC608 Crypto Auth module and the LSDM6DS3TR IMU module (I assumed these are not relevant to successful BLE functionality - are they?)
  • The BLE.begin() is in my setup() function and there's nothing else in the app. The rest of setup() is empty and the loop() function is empty as well.

-- UPDATE --

I was told that I probably need to update the firmware for the NINA W102 BLE module itself (assuming that's the cause of the problem in my original question), so I followed the instructions here: https://www.arduino.cc/en/Tutorial/WiFiNINA-FirmwareUpdater (WifiNina 1.5.0 library installed - the latest). Every time I hit "Update Firmware" (see screenshot), I get an error message, "Programmer Not Responding. Make sure that FirmwareUpdater sketch is loaded on the board." even though I have successfully loaded the sketch. (Also by the way, I have the latest version of Arduino IDE (1.8.13)).

To dig deeper, I uploaded the sketch via a debugger, and found that it is stuck in this loop of the FirmwareUpdater sketch:

if (!ESP32BootROM.begin(921600)) {
    Serial.println("Unable to communicate with ESP32 boot ROM!");
    while (1);
  }

The closest available solution on the internet to this problem is here https://forum.arduino.cc/index.php?topic=654833.0 and it did not work for me (still receive the same error, and I think that solution is outdated anyway).

Arduino Update Firmware

\$\endgroup\$
  • \$\begingroup\$ Have you enabled debug output (HCI.debug(Serial);)? If I'm not mistaken, the SAMD21 MCU talks via UART to the NINA W10 module for Bluetooth. Have you checked that communication with an oscilloscope? \$\endgroup\$ – Codo Jun 24 at 13:50
  • \$\begingroup\$ You can't debug something like this without understanding the circuit and the module and the interaction. Could be a module without firmware, could be a soldering or board issue. You need to monitor the communication with a scope or logic analyzer, inspect under high magnification, review the gerbers and unassembled boards, measure power consumption, etc. \$\endgroup\$ – Chris Stratton Jun 24 at 14:05
  • 1
    \$\begingroup\$ Have you uploaded the Arduino specific firmware to the NINA module? \$\endgroup\$ – Codo Jun 24 at 15:39
  • \$\begingroup\$ @Codo good point. I have not flashed the Nina Firmware, and didn't know I needed to until you recommended. I tried this and ran into further issues here: electronics.stackexchange.com/questions/507745/… . If I can successfully update the firmware and it turns out that that was the issue, I'll mark the issue as solved. \$\endgroup\$ – Kristoph Matthews Jun 27 at 15:45
  • \$\begingroup\$ Try holding the sketch processor in reset and tap in some wires so that you can talk to the ESP32 directly. Or transplant a flash chip for the ESP32 that has been programmed in another ESP32 board. And again, triple check the connections to the ESP32 both in theory and in inspecting the actual soldering. \$\endgroup\$ – Chris Stratton Jun 27 at 18:14
0
\$\begingroup\$

The ArduinoBLE library resets the esp32 NINA firmware to BLE mode (default mode is WiFi). But this reset is in ifdefs for specific boards and uses the specific pins to signal BLE mode and for reset of the esp32.

For Nano 33 IoT this pins are 24 (SPI SS) for signal and 27 for reset.

The communication with NINA firmware in BLE mode is over UART named SerialHCI on pins 22 to 25 on Nano 33 IoT.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks Juraj but how is this meant to help? I do see the Nano IoT 33 conditional in the IFDEFs and it seems to recognise it. But as you'll see in my edited question above, it fails in the ESP32BootROMClass::sync() function. \$\endgroup\$ – Kristoph Matthews Jun 27 at 18:05
  • \$\begingroup\$ @KristophMatthews ARDUINO_SAMD_NANO_33_IOT is there. do you select Nano 33 IoT in Tools menu? \$\endgroup\$ – Juraj Jun 27 at 18:29
  • \$\begingroup\$ Yes and I see it go there on the debugger \$\endgroup\$ – Kristoph Matthews Jun 27 at 18:31
  • \$\begingroup\$ some boards have inverted reset line to NINA \$\endgroup\$ – Juraj Jun 27 at 18:31
  • \$\begingroup\$ what is the reset line circuit on your board? \$\endgroup\$ – Juraj Jun 28 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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