Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feather ESP32-V2 and MAX3241 Featherwing #10053

Open
mikeysklar opened this issue Feb 12, 2025 · 3 comments
Open

Feather ESP32-V2 and MAX3241 Featherwing #10053

mikeysklar opened this issue Feb 12, 2025 · 3 comments

Comments

@mikeysklar
Copy link

mikeysklar commented Feb 12, 2025

CircuitPython version and board name

Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit Feather ESP32 V2 with ESP32

Code/REPL

import time
import board
import max3421e
import usb

spi = board.SPI()
cs = board.D33
irq = board.D15

host_chip = max3421e.Max3421E(spi, chip_select=cs, irq=irq)

while True:
    print("Finding devices:")
    for device in usb.core.find(find_all=True):
        # pylint: disable=line-too-long
        print(f"{device.idVendor:04x}:{device.idProduct:04x}: {device.manufacturer} {device.product}")
    time.sleep(5)

Behavior

Both CircuitPython 9.2.1 and the current 9.2.4 fail to discover a microSD adapter plugged into the MAX3421E when using a Feather V2. This is using the guide example USB host scan code.

This works with Arduino.

This works with (irq/cs pin changes) using CircuitPython 9.2.4 on a Feather RP2040 DVI.

Description

Working Feather RP2040 DVI

Adafruit CircuitPython 9.2.4 on 2025-01-28; Adafruit Feather RP2040 DVI with rp2040
Finding devices:
0781:cfcb: SanDisk SDDR-B531
Finding devices:
Finding devices:
0781:cfcb: SanDisk SDDR-B531

Feather V2 (CP 9.2.1, 9.2.4)

Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:

Arduino with same Feather V2

+---------------------------+---------+
| Component                 | Version |
+---------------------------+---------+
| macOS                     | 15.2    |
| Arduino IDE               | 2.3.4   |
| Adafruit TinyUSB Library  | 3.4.2   |
| ESP32 Library             | 3.1.1   |
+---------------------------+---------+
TinyUSB Dual: Device Info Example with MAX3421E
Device 1: ID 0781:cfcb
Device Descriptor:
  bLength             18
  bDescriptorType     1
  bcdUSB              0210
  bDeviceClass        0
  bDeviceSubClass     0
  bDeviceProtocol     0
  bMaxPacketSize0     64
  idVendor            0x0781
  idProduct           0xcfcb
  bcdDevice           2920
  iManufacturer       3     SanDisk
  iProduct            4     SDDR-B531
  iSerialNumber       2     052522000003619
  bNumConfigurations  1
Device 1: ID 0781:cfcb SanDisk SDDR-B531

Additional information

forum issue

@mikeysklar mikeysklar added the bug label Feb 12, 2025
@tannewt tannewt added the esp32 label Feb 13, 2025
@tannewt tannewt added this to the 9.x.x milestone Feb 13, 2025
@tannewt tannewt added the usb label Feb 13, 2025
@RetiredWizard
Copy link

RetiredWizard commented Feb 15, 2025

I'm seeing the same issue using a Feather ESP32-S2 and a Feather ESP32-S3 4m/2m. I think I got the Arduino simple example to detect occasionally but it only seemed to happen when I picked up the feather doubler so I think perhaps some signal noise may have been involved.

I did get a back to back QtPy ESP32-S2/USB host BFF working properly, however using jumper leads to connect the BFF to the Feather boards did not work. I also tried a QtPy ESP32-C3 and that had more serious problems (CircuitPython went to safe mode and Arduino boot looped). One interesting (and perhaps expected) observation was that when using the Arduino example, a device could only be detected once. i.e. If I plugged in a keyboard, all good, unplug, detected, plug in mouse, detected, unplug, detected, plug in original keyboard, not detected. Edit: The re-plug issue seems to be associated with the mouse I had lying around and probably not all that interesting after all

@mikeysklar Is there any chance you have a Feather S2 or S3 you could test against, would love to confirm this isn't something on my end.

@mikeysklar
Copy link
Author

I can hookup a Feather S2/S3 to confirm the behavior.

@mikeysklar
Copy link
Author

Feather ESP32-S2 Rev TFT
CircuitPython 9.2.4

It felt slow and unstable, but this controller did see the connected microSD card (briefly). Notice the Finding devices initially didn't pick it up over the first few passes, but then it did discover it.

Adafruit CircuitPython 9.2.4 on 2025-01-29; Adafruit Feather ESP32-S2 Reverse TFT with ESP32S2
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
0781:cfcb: SanDisk SDDR-B531
Finding devices:
0781:cfcb: SanDisk SDDR-B531
Finding devices:
0781:cfcb: SanDisk SDDR-B531
Finding devices:
0781:cfcb: SanDisk SDDR-B531

I reset the controller (reset button) and eve with multiple removal and inserts of the USB-A plug it failed to pick it up the same card.

Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:
Finding devices:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants