adafruit / Adafruit_TinyUSB_Arduino

Arduino library for TinyUSB
MIT License
465 stars 120 forks source link

TinyUSB MSC not working on ESP32-S3 #254

Closed brentru closed 1 year ago

brentru commented 1 year ago

Operating System

MacOS

Arduino IDE version

1.8.19

Board

Feather ESP32-S3, Feather ESP32-S3 Reverse TFT

ArduinoCore version

2.0.7

TinyUSB Library version

GitHub latest

Sketch & compiled Log (as attached txt files)

Sketch used: examples/MassStorage/msc_external_flash.ino

Upload settings (Note: I have also tried the TinyUSB partition) image

What happened ?

The feather hangs after uploading this example. The USB does not re-enumerate and an MSC USB drive does not appear.

How to reproduce ?

Upload msc_external_flash.ino to an Adafruit ESP32-S3 Feather such as the new Adafruit ESP32-S3 Reverse TFT.

Debug Log

No response

Screenshots

No response

brentru commented 1 year ago

May be related https://github.com/espressif/arduino-esp32/issues/7907

hathach commented 1 year ago

I just did an test with Feather eps32s3 and it seems to work well. There is a few gotcha though

Let me know if doing all of above changes work for you.

brentru commented 1 year ago

@hathach This did not work for me. I formatted the flash, used the FAT partition scheme and re-uploaded msc_external_flash. Upon hitting restart, my USB mouse stuttered the serial port never opened nor did the volume mount.

Are you on BSP 2.0.7?

hathach commented 1 year ago

I am using arduino-esp32 at master, it should already included 2.0.7. Can you try

Meanwhile I will try to use the exact release version of 2.0.7 to test with.

brentru commented 1 year ago

@hathach Same issue with msc_ramdisk on 2x machines at 2.0.7.

hathach commented 1 year ago

just switch to branch https://github.com/espressif/arduino-esp32/tree/release/v2.x to test, and it indeed has issue with TinyUSB lib, ESP32 repeatedly reset with both S2 and S3. Apparently there is difference between master and branch 2.x. I will try to llook more closely to find the root cause

ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x400262ed
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x524
load:0x4004c000,len:0xa70
load:0x40050000,len:0x2958
entry 0x4004c18c
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4002b1be  PS      : 0x00060c33  A0      : 0x8002a5ca  A1      : 0x3ffcc5d0  
A2      : 0x3ffc4550  A3      : 0x3ffcc774  A4      : 0x00060020  A5      : 0x00000000  
A6      : 0x400a0e0c  A7      : 0xffffffff  A8      : 0x3ffc4558  A9      : 0x00000001  
A10     : 0x00000000  A11     : 0x00000002  A12     : 0xfffffc18  A13     : 0x3ffc59f8  
A14     : 0x00060423  A15     : 0x3ffcc754  SAR     : 0x00000008  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0xfffffc18  LEND    : 0x3ffc59f8  LCOUNT  : 0x40027480  

Backtrace: 0x4002b1bb:0x3ffcc5d0 0x4002a5c7:0x3ffcc5f0 0x40029976:0x3ffcc610 0x40083e85:0x3ffcc650 0x400842ae:0x3ffcc670 0x40081d04:0x3ffcc690 0x400843b1:0x3ffcc6b0 0x400848a8:0x3ffcc6d0 0x40085145:0x3ffcc720
hathach commented 1 year ago

@brentru v2.0.0 should fix this issue, please give it a try

brentru commented 1 year ago

@hathach Thank you for resolving this issue via v2.0.0! Working for me.