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

Add a tinyusb_driver_uninstall to tinyusb.c (IEC-41) #229

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

johnboiles
Copy link
Contributor

@johnboiles johnboiles commented Aug 27, 2023

This makes it possible for user code to work around the bug where the USB/JTAG interface cannot be re-initialized after calling tinyusb_driver_install even if the chip is restarted with esp_restart (espressif/esp-idf#9826 (comment)).

Currently user code cannot do this without a modification to tinyusb.c since there's no way to access static usb_phy_handle_t phy_hdl; outside of that file.

With this change, user code can run the following to deactivate TinyUSB and bring back the USB/JTAG interface.

tinyusb_driver_uninstall();
usb_phy_config_t phy_conf = {
    .controller = USB_PHY_CTRL_SERIAL_JTAG,
};
usb_phy_handle_t jtag_phy;
usb_new_phy(&phy_conf, &jtag_phy);

@CLAassistant
Copy link

CLAassistant commented Aug 27, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title Add a tinyusb_driver_uninstall to tinyusb.c Add a tinyusb_driver_uninstall to tinyusb.c (IEC-41) Aug 27, 2023
@tore-espressif
Copy link
Collaborator

@johnboiles thank you very much for the PR, we will review ASAP

Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnboiles The changes LGTM!

Unfortunately, there is a conflict in usb/esp_tinyusb/include/tusb_cdc_acm.h could you please rebase your PR? And also check the nitpick from pre-commit about code format, thanks!

@johnboiles
Copy link
Contributor Author

Done!

@tore-espressif tore-espressif merged commit 67233bb into espressif:master Sep 7, 2023
62 checks passed
@tore-espressif
Copy link
Collaborator

Thank you very much @johnboiles ! Merged.

We will release new version of esp_tinyusb after we implement a quick fix for this issue: #217

@johnboiles johnboiles deleted the tinyusb-uninstall branch September 7, 2023 14:14
@johnboiles
Copy link
Contributor Author

Woohoo! Thanks @tore-espressif !

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

Successfully merging this pull request may close these issues.

4 participants