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

TinyUSB and DFS/Light Sleep (IDFGH-12132) #13188

Closed
3 tasks done
silverchris opened this issue Feb 15, 2024 · 2 comments
Closed
3 tasks done

TinyUSB and DFS/Light Sleep (IDFGH-12132) #13188

silverchris opened this issue Feb 15, 2024 · 2 comments
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@silverchris
Copy link

silverchris commented Feb 15, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello,
I am wondering about the correct way to handle this.
I am using an ESP32-S3
I have a self powered device that will be connected to a PC to transfer files to and from an SD card, and disconnected.

This works fine if I have DFS and light sleep off. But when turned on the computer can't configure the device.
I have been trying to find good place to take and release a esp_pm_lock.

I have tried an interrupt on the vbus_monitor_io pin, but that seems to be taken over by the USB peripheral, and doesn't seem to get called.

I have also tried it in the mount and premount callbacks, but that seems like it is too late.

What is the correct solution in this case?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 15, 2024
@github-actions github-actions bot changed the title TinyUSB and DFS/Light Sleep TinyUSB and DFS/Light Sleep (IDFGH-12132) Feb 15, 2024
@tore-espressif
Copy link
Collaborator

Hello @silverchris ,
During light sleep, the USB-OTG is clock-gated so it will not detect any USB event.

I can suggest the following:

esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ONE_INPUT, USB_SRP_BVALID_IN_IDX, false); 
  • Analogically, you can force disconnect state by
esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ZERO_INPUT, USB_SRP_BVALID_IN_IDX, false); 

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Feb 20, 2024
@silverchris
Copy link
Author

Awesome, that works! Thanks for the help @tore-espressif !

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants