-
Notifications
You must be signed in to change notification settings - Fork 35
feature(esp_tinyusb): Remote wakeup device test application [WIP] #309
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
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 introduces a test application for the Remote Wakeup feature on ESP32-S2, ESP32-S3, and ESP32-P4 devices, supporting both USB OTG 1.1 and USB OTG 2.0 interfaces.
Key Changes:
- Implements HID device test cases that verify remote wakeup functionality by suspending the USB device and triggering a wakeup signal followed by a keyboard input.
- Adds test infrastructure including event handling for suspend/resume states and common device test utilities.
- Provides SDK configuration with appropriate TinyUSB settings and disabled watchdogs for interactive testing.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
sdkconfig.defaults |
SDK configuration with TinyUSB HID settings, disabled watchdogs, and comprehensive heap/stack checking |
test_remote_wakeup.c |
Main test implementation with HID descriptors and two test cases for remote wakeup on different USB OTG ports |
test_app_main.c |
Test application entry point with ASCII art banner and Unity test runner setup |
idf_component.yml |
Component manifest specifying esp_tinyusb dependency |
device_common.h |
Header defining test device event types and utility function declarations |
device_common.c |
Event handling infrastructure with queue-based event management and TinyUSB callbacks |
main/CMakeLists.txt |
Component build configuration specifying source directories and dependencies |
CMakeLists.txt |
Project-level build configuration with minimal build optimization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
device/esp_tinyusb/test_apps/remote_wakeup/main/device_common.c
Outdated
Show resolved
Hide resolved
device/esp_tinyusb/test_apps/remote_wakeup/main/test_app_main.c
Outdated
Show resolved
Hide resolved
device/esp_tinyusb/test_apps/remote_wakeup/main/device_common.h
Outdated
Show resolved
Hide resolved
69f900e to
5a0ea7e
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 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
device/esp_tinyusb/test_apps/remote_wakeup/main/test_remote_wakeup.c
Outdated
Show resolved
Hide resolved
device/esp_tinyusb/test_apps/remote_wakeup/main/test_remote_wakeup.c
Outdated
Show resolved
Hide resolved
41530aa to
8ee9267
Compare
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on November 20. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
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 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tore-espressif
left a comment
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.
@roma-jam Thank you for preparing this test. Before moving forward, there are several points we should address:
-
Test app structure
Please analyze whether creating a new test_app is truly necessary for these two new test cases. Could they be integrated into an existing test application instead?
The motivation is to minimize build and test duration. Each additional test_app increases build time and significantly prolongs on-target testing (due to new artifacts, separate flashing, and setup). In contrast, extending an existing app with two new test cases would have a negligible impact on both build and execution time. -
Automation and CI integration
Please add a corresponding pytest_*.py file so these tests can run automatically in CI. This ensures the new functionality is continuously verified and doesn’t rely on manual execution. -
Reducing operator interaction
The current test procedure still requires considerable manual action, which makes it unsuitable for automated CI runs.
Since the USB Host library already supports the suspend feature and Remote Wake-up support is being added, it would be preferable to adapt this test to run fully automated between two ESP boards connected via USB. This approach aligns with how we already execute USB class driver tests and can reuse the existing dual-runner infrastructure.
| idf_component_register(SRC_DIRS . | ||
| INCLUDE_DIRS . | ||
| REQUIRES unity | ||
| PRIV_REQUIRES fatfs wear_levelling esp_partition esp_timer |
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.
Why do we need the storage components?
|
|
||
| CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL=y | ||
|
|
||
| CONFIG_COMPILER_CXX_EXCEPTIONS=y |
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.
There is no C++ in this project, so this might be redundant?
|
Hi @tore-espressif, I added this test to verify the Remote Wakeup feature and it just a bit more convenient, rather than use esp-idf example. Ok, I can keep it locally for now. Regarding the test refactoring, I already created a ticket with similar task (as we have already shared files). |
No, the goal is to have it in CI, running on our dual target runners |
|
Hi @tore-espressif, Yes-yes, I got it. I realised earlier, that the structure of esp_device test_apps might be optimised. But after your comment here, I suddenly realised it even more, in the way: „we do not need to build or to have in CI any test apps, that might be run only locally“. And sure, this is true, as why do we need to spend time to build apps, that we do not run.. Earlier, I thought that it is good to have them in the repo, as any of us could run them to test smth anytime. I agree, so I‘ll clean them. |
Description
Test application for Remote Wakeup feature on ESP32-S2, ESP32-S3, ESP32-P4 (USB OTG 1.1 and USB OTG 2.0).
Test requires external USB Host, which might be send to sleep mode by an operator.
Logic of the test is linear, all events (ATTACH, SUSPEND, RESUME) are verified and the test simplifies the verification of the feature:
Possible to run on USB1.1 for S2/S3 and on USB2.0 and USB1.1 for P4.
ESP32-P4 USB OTG 2.0
ESP32-P4, USB OTG 1.1
Related
N/A
Testing
Added additional test:

Checklist
Before submitting a Pull Request, please ensure the following: