-
Notifications
You must be signed in to change notification settings - Fork 37
feature(esp_tinyusb): TinyUSB task deletion notification driven (part 3/3) (IEC-441) #272
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: master
Are you sure you want to change the base?
Conversation
7c7d2a9 to
399a3e4
Compare
b0d1b6b to
4636e24
Compare
4636e24 to
88051eb
Compare
88051eb to
d2250d4
Compare
31fd0b0 to
d14fb88
Compare
d2250d4 to
4fdd710
Compare
d14fb88 to
1619f26
Compare
fa9ddc5 to
8cf8bf8
Compare
1619f26 to
019c18f
Compare
de9b405 to
2edb940
Compare
019c18f to
fd54244
Compare
2edb940 to
4c78584
Compare
|
I moved out the CPU Load improvements into another PR to unblock this one. As the CPU Load value it re-calculated Run Time, we can make a decision based on the Run Time value. CPU Load in percentage is nice to have feature and more user-friendly, but it is not important ATM. |
fd54244 to
adc2129
Compare
4c78584 to
6dc6c0d
Compare
adc2129 to
73b4ab0
Compare
6dc6c0d to
e78d3b8
Compare
eb0fbec to
6dca07a
Compare
eae16ec to
e3b601d
Compare
b6b9dc5 to
4d3bb52
Compare
370a8e2 to
c33acc5
Compare
| } else { | ||
| uint32_t response_len = ctrl_xfer->actual_num_bytes - USB_SETUP_PACKET_SIZE; | ||
| if (response_len <= req->wLength) { | ||
| memcpy(req->data, |
Check warning
Code scanning / clang-tidy
Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
c33acc5 to
01f9d68
Compare
- Fixed the _task_pending status change on error during tinyusb_task_start() - Kept the legace way of deleting task when blocking time is UINT32_MAX (task deleted in the user context) - Added blocking_timeout_ms parameter to the driver config, tinyusb task parameters
01f9d68 to
15a5ed5
Compare
Description
This is the third and the final part of the plan: Make the TinyUSB task deletion notification driven
Implement the mechanism:
xTaskNotify.tud_task_ext(timeout_ms, false)with the configured timeout.timeout_ms == 0(legacy way of task deletion).Additional tasks
_task_is_runningbug (feature(tinyusb): Software VBUS monitoring feature on ESP32P4 (part1/2) (IEC-437) #305 (review))Run TimeandCPU loadin default mode (1s blocking) and legacy mode (indefinite blocking) are the same)Profile the precise percentage calculation to find the calculation error (the total sum of percentage should be exactly 100%, find and eliminate the problem)Re-measure the results for CPU Load with precise percentageCPU Load value has been excluded from this PR as it is re-calculated Run Time value.
The TinyUSB task CPU load is measured via the Run Time value instead.
The CPU Load calculation add on is in follow-up PR: [TBC]
Test description
CPU load test case was used as a measurement tool.
As the results vary from the launch, the test was launched three times in a row.
Test steps:
After each launch, the result was placed in the table:
result1 / result2 / result 3, for example461 / 458 / 462CPU Load all the time less than 1%, because tasks
IDLE0andIDLE1use most of the CPU:Run Time and CPU Load of TinyUSB task for ESP32-S3
timeout_ms = 0)timeout_ms = 2000)timeout_ms = UINT32_MAX)Run Time and CPU Load of TinyUSB task for ESP32-P4 (ECO5)
timeout_ms = 0)timeout_ms = 1000)timeout_ms = UINT32_MAX)Notes
Default timeout values may differ per CPU/target to match CPU load observed in legacy (block-forever) mode versus non-blocking mode. To minimize the difference with legacy mode the default timeout was selected based on the Run Time value according to the table above.
Related
Testing
Checklist
Before submitting a Pull Request, please ensure the following: