adafruit / adafruit/Adafruit_CircuitPython_miniesptool

Feather / Metro RP2350 Airlift Update Support

Open
#31 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
8
PR merge metrics
No merged PRs in 30d

Description

There is a new generation of users that [only have RP2350 boards](https://forums.adafruit.com/viewtopic.php?t=221476). They cannot update their Airlift firmware with a M4 or RP2040 without purchasing one for the task.

## Summary

Failure always occurs at flash_begin() inside flash_file() `ESP_FLASH_BEGIN` (`opcode 0x02`) with:

```
Flashing NINA_ADAFRUIT-esp32-3.3.0.bin

Writing NINA_ADAFRUIT-esp32-3.3.0.bin w/filesize: 1333248
Erase size 1333248, num_blocks 2604, size 512, offset 0x0000

=== check_command ===
opcode: 0x2
buffer len: 16 checksum: 0 timeout: 13
['0xc0', '0x0', '0x2', '0x10', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0',
'0x10', '0x0', '0x0', '0x8', '0x0', '0x0', '0x0', '0x0', '0x2', '0x0',
'0x0', '0x0', '0x0', '0x0', '0x0', '0xc0']
Writing: bytearray(b'\xc0\x00\x02\x10\x00\x00\x00\x00\x00\x00\x10\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\xc0')
Timed out after 13 seconds
raw value: None
raw data: None len = 0
DEBUG: NO HEADER received for opcode 0x2
flash_begin() RAISED: RuntimeError("Didn't get enough status bytes",)
```

This is the exact exception:
```
Writing NINA_ADAFRUIT-esp32-3.3.0.bin w/filesize: 1333248
Erase size 1269760, num_blocks 2604, size 512, offset 0x0000
Traceback (most recent call last):
File "code.py", line 43, in
File "adafruit_miniesptool.py", line 500, in flash_file
File "adafruit_miniesptool.py", line 322, in flash_begin
File "adafruit_miniesptool.py", line 354, in check_command
RuntimeError: Didn't get enough status bytes
```

This happens on both **Feather RP2040** and **Feather RP2350** with an **AirLift FeatherWing** (ESP32-MINI-1), across multiple CircuitPython and `miniesptool` versions.

The same hardware + wiring flashes NINA successfully when using the official **RP2040 passthru UF2 + desktop `esptool.py`**, so the issue appears specific to the CircuitPython/UART/miniesptool path.

---

## Hardware

- **Host boards tested:**
- Adafruit Feather **RP2040**
- Adafruit Feather **RP2350**
- **WiFi module:**
- Adafruit AirLift FeatherWing (ESP32-U4WDH, NINA-style firmware)
- **Connection:**
- Standard Feather + AirLift FeatherWing stacking
- Using UART pins and reset/GPIO0 as per guides

---

## Software / Versions

- **CircuitPython:**
- 10.0.0
- 10.0.3
- 10.1.0-beta.1

- **`adafruit_miniesptool`:**
- 0.2.25 (rolled back via local copy on CIRCUITPY)
- 0.2.26 (current, with ESP32-C6 support)

- **Desktop tooling for passthru test:**
- `esptool.py v4.8.1` on macOS

---

## Minimal `code.py` (Feather RP2350 + AirLift)

This is the test script I’m using on the **Feather RP2350** (very similar script also used on Feather RP2040):

```python
import time
import board
import busio
from digitalio import DigitalInOut
import adafruit_miniesptool

print("ESP32 Nina-FW Loader (Feather RP2350 + AirLift FeatherWing)")

tx = getattr(board, "ESP_TX", board.TX)
rx = getattr(board, "ESP_RX", board.RX)
resetpin = getattr(board, "ESP_RESET", board.IO4)
gpio0pin = getattr(board, "ESP_GPIO0", board.D10)

uart = busio.UART(tx, rx, baudrate=115200, timeout=1)

esptool = adafruit_miniesptool.miniesptool(
uart,
DigitalInOut(gpio0pin),
DigitalInOut(resetpin),
flashsize=4 * 1024 * 1024,
)

print("Resetting + syncing...")
esptool.sync()
print("Synced")
print("Found:", esptool.chip_name)
print("Baudrate (initial):", esptool.baudrate)
print("MAC ADDR:", [hex(i) for i in esptool.mac_addr])

for new_baud in (912600, 460800, 230400):
try:
print("Trying faster baudrate:", new_baud)
esptool.baudrate = new_baud
print("New baudrate set:", esptool.baudrate)
break
except Exception as e:
print("Failed to set baudrate", new_baud, "->", e)
else:
print("Staying at 115200; high-speed baud change failed.")

FILENAME = "NINA_ADAFRUIT-esp32-3.3.0.bin"
print("Flashing", FILENAME)
esptool.flash_file(FILENAME, 0x0)

print("Done flashing, resetting ESP32...")
esptool.reset()
time.sleep(0.5)
print("All done.")
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with adafruit_miniesptool.py, especially flash_file(), flash_begin(), and check_command(), and compare the CircuitPython path with the successful desktop esptool.py passthru test described here. Reproduce the ESP_FLASH_BEGIN timeout on the listed RP2040/RP2350 setup; done means NINA_ADAFRUIT-esp32-3.3.0.bin flashes successfully through the CircuitPython UART path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.