-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
ESP32 S3 TinyUSB problems with USB unplugging detection (IDFGH-11193) #12360
Comments
hi @SlySquirrel could you please share your HW connection of VBUS to ESP32-S3? |
Hi, I use hw design similar as https://github.com/wuxx/nanoESP32-S3 with battery supply and VBUS connection |
Thanks, I'll try to reproduce the problem with your HW setup and let you know ;) |
I am also having this issue. If I read the GPIO with gpio_get_level, it returns the expected value with usb connected and disconnected. |
Hi, I'm sorry for the extraordinary slow responses here. I'll get to it ASAP |
Hello @silverchris and @SlySquirrel thank you for your patience. In the meanwhile, you can use tinyusb v0.14. It contains the same features for MSC device as v0.15. You can do this be requiring specific version in your ## IDF Component Manager Manifest File
dependencies:
espressif/esp_tinyusb: "^1.4.2"
espressif/tinyusb: '0.14.2' Also please make sure that the pin you are using for VBUS monitoring is not used by any other peripheral. Here's a nice summary for ESP32-S3 https://www.luisllamas.es/en/which-pins-can-i-use-on-esp32-s3/ |
@tore-espressif downgrading to 0.14.2 fixed it for me. Thank you! |
Hi, Question: when the USB Storage is exposed to the Host, the Storage is no more accessible by the Application ? |
https://github.com/espressif/esp-idf/tree/b3f7e2c/examples/peripherals/usb/device/tusb_msc well described here. so a "Shared" Access is per Standard not possible right ? |
This is not per (USB) Standard but per differences how the MSC host and the application access the memory partition. The MSC host accesses memory sectors while the application accesses files (implemented in FATFS): in general it is impossible to ensure file consistency when the disk is mounted both to the app and to the host (Unless both the host and the device mount the FS read-only) |
Just to add, MTP class tries to address this problem. Here is the issue about supporting it in tinyusb: hathach/tinyusb#1079 |
@igrr very cool |
Hello everyone,
New version is available: espressif/tinyusb^0.15.0~5 |
Answers checklist.
IDF version.
esp-idf-v5.1.1
Espressif SoC revision.
ESP32 S3
Operating System used.
Linux
How did you build your project?
Eclipse IDE
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-S3-WROOM-1
Power Supply used.
USB
What is the expected behavior?
I'm using an example tusb_msc from esp-idf-v5.1.1 and using spiflash to store files. My device is expected to be Self-Powered Device.
I did everything as described in this documentation in the section Self-Powered Device
const tinyusb_config_t tusb_cfg = {
.device_descriptor = &descriptor_config,
.string_descriptor = string_desc_arr,
.string_descriptor_count = sizeof(string_desc_arr) / sizeof(string_desc_arr[0]),
.external_phy = false,
.configuration_descriptor = desc_configuration,
.self_powered = true,
.vbus_monitor_io = GPIO_NUM_1
};
I expect that when I disconnect the device from USB I will have access to files on the SPI flash. But when I disconnect the device from the PC, the tud_umount_cb() function is not called and tinyusb_msc_storage_in_use_by_usb_host() returns true. Function tud_umount_cb() call only when I umount device from PC, if remove device without umount from PC there is no event to determine whether the device is connected or not.
What is the actual behavior?
I expected that using the vbus_monitor_io would generate a connection and disconnection event on the USB bus.
Steps to reproduce.
Flash tusb_msc example and remove from PC without manual umount.
Debug Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: