-
Notifications
You must be signed in to change notification settings - Fork 35
feature(tinyusb): Software VBUS monitoring feature on ESP32P4 (part2/2) #307
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
base: feature/vbus_monitor_esp32p4_part1
Are you sure you want to change the base?
feature(tinyusb): Software VBUS monitoring feature on ESP32P4 (part2/2) #307
Conversation
03caa71 to
f439723
Compare
57de566 to
85e04ef
Compare
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 implements software VBUS monitoring functionality for ESP32P4, the second part of a two-part implementation. It adds GPIO-based interrupt handling with debounce logic to detect VBUS presence and automatically control USB device connection/disconnection by overriding the GOTGCTL.BVALID signal.
- Implements GPIO ISR with debounce timer for VBUS state detection
- Adds low-level USB DWC register manipulation functions for BVALID override control
- Enables previously disabled test cases for VBUS monitoring functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tinyusb_vbus_monitor.c | Core implementation of VBUS monitoring with GPIO ISR, debounce logic, and USB register control |
| test_vbus_monitor.c | Enables test cases by replacing placeholder return values with actual test function calls |
| tinyusb_vbus_monitor.h | Updates function signatures and documentation for new return types and error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f439723 to
fee7783
Compare
85e04ef to
f388b64
Compare
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a744c34 to
3a4f14a
Compare
f388b64 to
3325a80
Compare
f573418 to
a8fbded
Compare
3325a80 to
3181ea4
Compare
a8fbded to
652c0fb
Compare
3181ea4 to
b7434a9
Compare
652c0fb to
057986d
Compare
b7434a9 to
038ddc8
Compare
d311914 to
623809e
Compare
038ddc8 to
94ebda9
Compare
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.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on November 20
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
623809e to
d298a66
Compare
94ebda9 to
137ba53
Compare
97354e1 to
15fb575
Compare
0379ebd to
4953363
Compare
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4953363 to
c2dbd6f
Compare
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cf4fd4a to
6e1c6a8
Compare
- added GPIO ISR, debounce timer, debounce logic - added GOTGCTL.BVALID driving on VBUS appear/disappear - added DCTL.SFTDISCON driving on VBUS appear/dissapear
6e1c6a8 to
6b9d6ea
Compare
|
Hi This PR is ready. PTAL! |
| } | ||
|
|
||
| /** | ||
| * @brief TinyUSB Attach/Detach events test, when VBUS monitoring is enabled and connected to GPIO |
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.
Did you get expected results in this testcase?
IIRC, the USB-DWC does not only check state of BVALID signal but also state of D+ and D-. Eg. if you deassert bValid, but D+ and D- stay connected, the detachment might not be detected
Description
VBUS monitoring on ESP32-P4 - Part 2/2
Related
Testing
Verification
Verification is made by launching the vbus_monitor test application test cases.
To verify all scenarios, additional hardware features should be done with a dev board:
Checklist
Before submitting a Pull Request, please ensure the following:
Note
Implements GPIO ISR + debounce-driven VBUS monitoring (with DWC BVALID override/soft-disconnect) on ESP32-P4, updates API to return esp_err, and enables corresponding tests and example setup.
device/esp_tinyusb/tinyusb_vbus_monitor.c.GOTGCTL.BVALIDandDCTL.SFTDISCONon VBUS appear/disappear (ESP32-P4).esp_err_t; cleans up ISR, GPIO, timer, and disables BVALID override.tinyusb_vbus_monitor.h: document new error returns; changetinyusb_vbus_monitor_deinitsignature to returnesp_err_t.test_vbus_monitor.c):tinyusb_driver_installinmsc_device.c.Written by Cursor Bugbot for commit 6b9d6ea. This will update automatically on new commits. Configure here.