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

feature(usbd): Added tud_teardown() #27

Closed
wants to merge 1 commit into from

Conversation

roma-jam
Copy link
Collaborator

Requirements

When tinyusb driver is configured and installed, there are no option to reconfigure device, without powering cycle.

To be able to change USB Device class with reinstalling tinyusb driver, there should be a mechanism to teardown (disble, close and free) everything inside tinyusb.

Limitations

  • Available only for Device stack (Not implemented with TUH_OPT_RHPORT)
  • Verified only for dcd_dwc2 hardware. (tud_teadown() calls dcd_int_disable() which should be implemented in dcd layer)

Breaking change

  • Added bool tud_teardown (uint8_t rhport) in usbd.c. This is a breaking change for previous versions.

Close espressif/esp-idf#13788

@roma-jam roma-jam self-assigned this Jun 11, 2024
@roma-jam roma-jam marked this pull request as ready for review June 11, 2024 11:50
@roma-jam roma-jam changed the title feature(usbd): Added tusb_teardown() feature(usbd): Added tud_teardown() Jun 11, 2024
@tore-espressif
Copy link
Collaborator

@roma-jam Upstream TinyUSB added this feature in release v0.17.0 https://github.com/hathach/tinyusb/blob/master/src/device/usbd.c#L496

We can rebase on top of 0.17 to get this feature so we are synced with upstream. Do you agree?

@roma-jam
Copy link
Collaborator Author

roma-jam commented Sep 16, 2024

@tore-espressif , yes, sure.

UPD:

I have checked, and there were also class deint call added: hathach@c3c0648

But I don't see that it is somehow available for the user, because the function is still commented out:
https://github.com/hathach/tinyusb/blob/master/src/tusb.h#L142

So, after a rebase, few steps should be added to use the teardown mechanism.

@greenaddress
Copy link

@roma-jam happy to assist with testing when there's a WIP Pr for the various pieces

@roma-jam
Copy link
Collaborator Author

Closed as upstream already has implementation of this feature.
Planned update to the upstream.

@roma-jam roma-jam closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants