-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat(tinyusb_cdc): avoid infinite loop when TinyUSB CDC layer hangs #11904
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
Conversation
Added a timeout check to prevent locking during CDC writes.
👋 Hello SuGlider, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 14m 13s ⏱️ Results for commit 8833edb. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a timeout mechanism to prevent infinite loops when the TinyUSB CDC layer hangs during write operations. The change addresses a critical issue where the ESP32-S3/S2 devices could become locked when CDC writing operations fail.
- Added timeout check in the CDC write loop to prevent indefinite blocking
- Introduced error logging when timeout occurs or USB disconnects
- Enhanced robustness of CDC communication by avoiding system lockup
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
Description of Change
Added a timeout check to prevent locking during CDC writing.
Test Scenarios
ESP32-S3/S2 with the sketch:
Related links
Related to, but not final solution for:
#10836
#11600
#10307