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

esp_tinyusb: Adding bvalid_signal test #10

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

roma-jam
Copy link
Collaborator

@roma-jam roma-jam commented Feb 5, 2024

esp_tinyusb v1.4.4

NOT A RELEASE

Change description

  • Added a usb_device test for bvalid_signal verification.

Details

USB Device events, such as attach (plug) and detach (unplug) are detected via bvalid_signal, which can be connected to any (*mostly) external PIN. (In the most common cases, this external PIN connected to VBUS USB via resistor divider to detect the VBUS power presence. For reference, check Self-Powered Device)

When USB Device (self-powered) is attached to the USB Host, the VBUS becomes High.
When USB Device (self-powered) is detached from the USB Host, the VBUS becomes Low.
Both of attach and detach, trigger the dcd_dwc2 layer interrupt with DCD_EVENT_UNPLUGGED event.

Current test implement the USB Device without any interface and connect the bvalid_signal to the High or Low signal source to emulate the VBUS presence/absence.
For smoke testing, 10 iterates is enough to see that logic is working.
For load testing, please, change the parameter DEVICE_DETACH_TEST_ROUNDS in test_bvalid_sig.c.

Important notice

Without changes in espressif/tinyusb#19 the test doesn't work.

@roma-jam roma-jam force-pushed the feature/esp_tinyusb_bvalid_signal_test branch from fab7d9f to 95b3ee9 Compare February 5, 2024 13:46
@roma-jam roma-jam self-assigned this Feb 5, 2024
@roma-jam roma-jam marked this pull request as ready for review February 5, 2024 18:04
@roma-jam roma-jam changed the title esp_tinyusb: Adding bvalid_signal test esp_tinyusb v1.4.4: Adding bvalid_signal test Feb 5, 2024
@roma-jam roma-jam force-pushed the feature/esp_tinyusb_bvalid_signal_test branch from 95b3ee9 to 0da1e0d Compare February 6, 2024 11:01
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.

@roma-jam Thank for the test! Could you please add another test that would the same as bvalid_signal but with ongoing transfers?

Also please consider renaming to sudden disconnection... :)

device/esp_tinyusb/CHANGELOG.md Outdated Show resolved Hide resolved
device/esp_tinyusb/CHANGELOG.md Outdated Show resolved Hide resolved
device/esp_tinyusb/test/test_bvalid_sig.c Show resolved Hide resolved
@roma-jam roma-jam force-pushed the feature/esp_tinyusb_bvalid_signal_test branch 2 times, most recently from 91da76e to 5dede2c Compare February 6, 2024 15:55
@roma-jam roma-jam changed the title esp_tinyusb v1.4.4: Adding bvalid_signal test esp_tinyusb: Adding bvalid_signal test Feb 6, 2024
@roma-jam roma-jam force-pushed the feature/esp_tinyusb_bvalid_signal_test branch from 5dede2c to 1325870 Compare February 12, 2024 09:27
@roma-jam roma-jam force-pushed the feature/esp_tinyusb_bvalid_signal_test branch from 1325870 to d0b5b2e Compare February 13, 2024 08:23
@roma-jam roma-jam merged commit 1415c25 into master Feb 13, 2024
11 checks passed
@roma-jam roma-jam deleted the feature/esp_tinyusb_bvalid_signal_test branch February 13, 2024 08:40
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