Metro M4 Airlift Lite - ESP32 did not respond with a startup

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PierreDeQuebec
 
Posts: 96
Joined: Sun Jul 25, 2021 3:26 pm

Metro M4 Airlift Lite - ESP32 did not respond with a startup

Post by PierreDeQuebec »

Hi,

After following the instructions to update the ESP32 microcontroller, I get the error message "ESP32 did not respond with a startup message." The error occurs in the line of code.

Code: Select all

adapter = esp32.start_bluetooth ()
In the example to test the BLE connection. I am using CircuitPython 6.3.0 with the adafruit-circuitpython-bundle-6.x-mpy-20210725 series library. My card has absolutely nothing to connect except the usb-B cable with a communication on the port /dev /ttyACM1. A point that bothers me in the instructions. After having "flashed" ESP32, it is written.
Once the firmware is fully uploaded, the ESP32 will reset and the NeoPixel will glow blue.
But in my case, the NEOPIXEL LED is not blinking blue. In fact, it remains completely off. And then I am forced to reinstall CircuitPython. Is this normal? And, of course, I would appreciate to have some help getting the BLE communication to work.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by mikeysklar »

Hello PierreDeQuebec,

Were you also able to update the Metro M4 bootloader for the core processor? The current version is 3.13.0 (Feb 2021 release).

https://circuitpython.org/board/metro_m4_airlift_lite/

It sounds like something has gone awry with the ESP32 update. Did you follow our guide and use nina-fw 1.7.4?

https://learn.adafruit.com/upgrading-es ... -one-board

The above also provides a way to check that the firmware upgraded correctly with a quick wifi setup and watching the REPL output.

https://learn.adafruit.com/upgrading-es ... 3041772-30

Once we verify that you were successful in getting the nina-fw loaded we can look at the bluetooth issue.

User avatar
PierreDeQuebec
 
Posts: 96
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by PierreDeQuebec »

Thank you for taking the time to resolve my problem.

I followed the instructions to the letter and still get the same result. Here are the console outputs:

A) ESP32 firmware update. I reloaded the update-bootloader-metro_m4_airlift-v3.13.0.uf2 file.

Code: Select all

UF2 Bootloader v3.13.0 SFHWRO
Model: Metro M4 AirLift
Board-ID: SAMD51J19A-Metro-AirLift-v0
For updating with nina-fw 1.7.4. I used Metro_M4_WiFi_ESP32_Passthru.UF2 for a Metro M4 Airlift Lite. Here the process goes sour. My mini controller plays dead! No LED lights up. Nothing! I then continue with esptool.py and the NINA_W102-1.7.4.bin file with the Metro M4 in BOOT mode. I then get the following message:

Code: Select all

lun jui 26 $ esptool.py --port /dev/ttyACM0 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.7.4.bin
esptool.py v3.1
Serial port /dev/ttyACM0
WARNING: Pre-connection option "no_reset" was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header
On the other hand, if I exit BOOT mode, then the update seems to be done and I get.

Code: Select all

lun jui 26$  esptool.py --port /dev/ttyACM0 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.7.4.bin
esptool.py v3.1
Serial port /dev/ttyACM0
WARNING: Pre-connection option "no_reset" was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
Connecting........__
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: ac:67:b2:77:34:3c
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x0011afff...
Compressed 1159168 bytes to 633594...
Wrote 1159168 bytes (633594 compressed) at 0x00000000 in 56.1 seconds (effective 165.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
But, CircuitPython is erased and I have to reinstall it. Once reinstalled, I find my code.py file intact with the following code (the proposed test).

Code: Select all

# ble_test.py

import board

from lib.adafruit_ble import BLERadio
from lib.adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from lib.adafruit_ble.services.nordic import UARTService

from lib.adafruit_airlift.esp32 import ESP32

# If you are using a Metro M4 Airlift Lite, PyPortal,
# or MatrixPortal, you can use the default pin settings.
# Leave this DEFAULT line uncommented.
# esp32 = ESP32()  # DEFAULT

# If you are using CircuitPython 6.0.0 or earlier,
# on PyPortal and PyPortal Titano only, use the pin settings
# below. Comment out the DEFAULT line above and uncomment
# the line below. For CircuitPython 6.1.0, the pin names
# have changed for these boards, and the DEFAULT line
# above is correct.
esp32 = ESP32(tx=board.TX, rx=board.RX)

# If you are using an AirLift FeatherWing or AirLift Bitsy Add-On,
# use the pin settings below. Comment out the DEFAULT line above
# and uncomment the lines below.
# If you are using an AirLift Breakout, check that these
# choices match the wiring to your microcontroller board,
# or change them as appropriate.
# esp32 = ESP32(
#     reset=board.D12,
#     gpio0=board.D10,
#     busy=board.D11,
#     chip_select=board.D13,
#     tx=board.TX,
#     rx=board.RX,
# )

# If you are using an AirLift Shield,
# use the pin settings below. Comment out the DEFAULT line above
# and uncomment the lines below.
# esp32 = ESP32(
#     reset=board.D5,
#     gpio0=board.D6,
#     busy=board.D7,
#     chip_select=board.D10,
#     tx=board.TX,
#     rx=board.RX,
# )

adapter = esp32.start_bluetooth()

ble = BLERadio(adapter)
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)

while True:
    ble.start_advertising(advertisement)
    print("waiting to connect")
    while not ble.connected:
        pass
    print("connected: trying to read input")
    while ble.connected:
        # Returns b'' if nothing was read.
        one_byte = uart.read(1)
        if one_byte:
            print(one_byte)
            uart.write(one_byte) 

And there I get the error message:

Code: Select all

Traceback (appels les plus récents en dernier) :
  Fichier "code.py", ligne 51, dans <module>
  Fichier "adafruit_airlift/esp32.py", ligne 178, dans start_bluetooth
  Fichier "adafruit_airlift/esp32.py", ligne 137, dans reset
RuntimeError: ESP32 did not respond with a startup message

Cordially

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by mikeysklar »

@PierreDeQuebec,

It looks like your Metro M4 is getting through the nina-fw update correctly once it is out of BOOT mode which makes sense as the pass through code needs to be running.

The ble_test.py script appears to be an issue. I think you need to adjust this script to uncomment the line I've highlighted here and comment out the second.

Code: Select all

esp32 = ESP32()  # DEFAULT

Code: Select all

#esp32 = ESP32(tx=board.TX, rx=board.RX)

User avatar
PierreDeQuebec
 
Posts: 96
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by PierreDeQuebec »

I correct the code as indicated and I always have the same error message ! Should I suspect a faulty circuit.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by mikeysklar »

Since you have communication withe the ESP32 during FW upgrade I suspect the Firmware update to nina-1.7.2 is more likely than a hardware issue of any type.

Can you try going back to the Nina-1.7.1 release which the guide was written and tested on?

Also here is the code example to try in full:

https://learn.adafruit.com/adafruit-met ... python-ble

Code: Select all

import board

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

from adafruit_airlift.esp32 import ESP32

# If you are using a Metro M4 Airlift Lite, PyPortal,
# or MatrixPortal, you can use the default pin settings.
# Leave this DEFAULT line uncommented.
esp32 = ESP32() # DEFAULT

# If you are using CircuitPython 6.0.0 or earlier,
# on PyPortal and PyPortal Titano only, use the pin settings
# below. Comment out the DEFAULT line above and uncomment
# the line below. For CircuitPython 6.1.0, the pin names
# have changed for these boards, and the DEFAULT line
# above is correct.
# esp32 = ESP32(tx=board.TX, rx=board.RX)

# If you are using an AirLift FeatherWing or AirLift Bitsy Add-On,
# use the pin settings below. Comment out the DEFAULT line above
# and uncomment the lines below.
# If you are using an AirLift Breakout, check that these
# choices match the wiring to your microcontroller board,
# or change them as appropriate.
# esp32 = ESP32(
#     reset=board.D12,
#     gpio0=board.D10,
#     busy=board.D11,
#     chip_select=board.D13,
#     tx=board.TX,
#     rx=board.RX,
# )

# If you are using an AirLift Shield,
# use the pin settings below. Comment out the DEFAULT line above
# and uncomment the lines below.
# esp32 = ESP32(
#     reset=board.D5,
#     gpio0=board.D6,
#     busy=board.D7,
#     chip_select=board.D10,
#     tx=board.TX,
#     rx=board.RX,
# )

adapter = esp32.start_bluetooth()

ble = BLERadio(adapter)
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)

while True:
    ble.start_advertising(advertisement)
    print("waiting to connect")
    while not ble.connected:
        pass
    print("connected: trying to read input")
    while ble.connected:
        # Returns b'' if nothing was read.
        one_byte = uart.read(1)
        if one_byte:
            print(one_byte)
            uart.write(one_byte)

User avatar
PierreDeQuebec
 
Posts: 96
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by PierreDeQuebec »

It works! Your code works :)

The error was on my side (another 18 "in front of the screen). In my imports, I prefixed with 'lib.' to allow Pycharm to trace modules correctly. But for some reason CircuitPython does just fine without the 'lib' prefix but not Pycharm. Oddly enough, I put the prefix in my main program and everything works fine (LCD1602 + Adafruit Ultimate GPS & Logging Shield + BMP390). I'll dig this to make sure I don't have any other import issues.

Sincerely, thank you for your help.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by mikeysklar »

Great. It was just a matter of loading the right example code then?

User avatar
PierreDeQuebec
 
Posts: 96
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro M4 Airlift Lite - ESP32 did not respond with a sta

Post by PierreDeQuebec »

To conclude. Indeed, the example code works very well. For Pycharm, I fixed the problem by adding the CircuitPython library path to my hard drive to it. Like that, I no longer have to prefix imports at the risk of confusing CircuitPython.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”