diff --git a/components/usb/hcd_dwc.c b/components/usb/hcd_dwc.c index 53fdb0a189..a5ea7d736f 100644 --- a/components/usb/hcd_dwc.c +++ b/components/usb/hcd_dwc.c @@ -62,7 +62,7 @@ // FS: Must be 2-64. HS: Must be 8-256. See USB-OTG databook Table 5-47 #define XFER_LIST_LEN_INTR FRAME_LIST_LEN #define XFER_LIST_LEN_ISOC 64 // Implement longer ISOC transfer list to give us enough space for additional timing margin -#define XFER_LIST_ISOC_MARGIN 2 // The 1st ISOC transfer is scheduled 2 (micro)frames later so we have enough timing margin +#define XFER_LIST_ISOC_MARGIN 3 // The 1st ISOC transfer is scheduled 3 (micro)frames later so we have enough timing margin // ------------------------ Flags -------------------------- diff --git a/components/usb/test_apps/hcd/main/test_hcd_bulk.c b/components/usb/test_apps/hcd/main/test_hcd_bulk.c index 8d72020012..8edcdd95ae 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_bulk.c +++ b/components/usb/test_apps/hcd/main/test_hcd_bulk.c @@ -53,7 +53,7 @@ Procedure: #define TEST_NUM_SECTORS_TOTAL 10 #define TEST_NUM_SECTORS_PER_XFER 2 -TEST_CASE("Test HCD bulk pipe URBs", "[bulk][full_speed]") +TEST_CASE("Test HCD bulk pipe URBs", "[bulk][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) diff --git a/components/usb/test_apps/hcd/main/test_hcd_ctrl.c b/components/usb/test_apps/hcd/main/test_hcd_ctrl.c index 75190e41c8..6d951d0628 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_ctrl.c +++ b/components/usb/test_apps/hcd/main/test_hcd_ctrl.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -33,7 +33,7 @@ Procedure: - Expect URB to be USB_TRANSFER_STATUS_CANCELED or USB_TRANSFER_STATUS_COMPLETED - Teardown */ -TEST_CASE("Test HCD control pipe URBs", "[ctrl][low_speed][full_speed]") +TEST_CASE("Test HCD control pipe URBs", "[ctrl][low_speed][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) @@ -110,7 +110,7 @@ TEST_CASE("Test HCD control pipe URBs", "[ctrl][low_speed][full_speed]") /* Test HCD control pipe STALL condition, abort, and clear -@todo this test is not passing with low-speed: test with bus analyzer +@todo this test is not passing with low-speed: test with bus analyzer IDF-10995 Purpose: - Test that a control pipe can react to a STALL (i.e., a HCD_PIPE_EVENT_ERROR_STALL event) @@ -128,7 +128,7 @@ Procedure: - Dequeue URBs - Teardown */ -TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed]") +TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) @@ -217,6 +217,8 @@ TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed]") /* Test control pipe run-time halt and clear +@todo this test is not passing on P4: test with bus analyzer IDF-10996 + Purpose: - Test that a control pipe can be halted with HCD_PIPE_CMD_HALT whilst there are ongoing URBs - Test that a control pipe can be un-halted with a HCD_PIPE_CMD_CLEAR diff --git a/components/usb/test_apps/hcd/main/test_hcd_isoc.c b/components/usb/test_apps/hcd/main/test_hcd_isoc.c index 0526f866af..1f6420bf81 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_isoc.c +++ b/components/usb/test_apps/hcd/main/test_hcd_isoc.c @@ -39,7 +39,7 @@ Procedure: - Teardown */ -TEST_CASE("Test HCD isochronous pipe URBs", "[isoc][full_speed]") +TEST_CASE("Test HCD isochronous pipe URBs", "[isoc][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection // The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing @@ -114,7 +114,7 @@ Procedure: - Deallocate URBs - Teardown */ -TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") +TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection // The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing @@ -163,7 +163,7 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") } // Add a delay so we start scheduling the transactions at different time in USB frame - esp_rom_delay_us(ENQUEUE_DELAY * interval + ENQUEUE_DELAY * channel); + esp_rom_delay_us(ENQUEUE_DELAY * (interval - 1) + ENQUEUE_DELAY * channel); // Enqueue URBs for (int i = 0; i < NUM_URBS; i++) { @@ -226,7 +226,7 @@ Procedure: - Free both pipes - Teardown */ -TEST_CASE("Test HCD isochronous pipe sudden disconnect", "[isoc][full_speed]") +TEST_CASE("Test HCD isochronous pipe sudden disconnect", "[isoc][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection // The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing diff --git a/components/usb/test_apps/hcd/main/test_hcd_port.c b/components/usb/test_apps/hcd/main/test_hcd_port.c index f629920c0e..fe77f85604 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_port.c +++ b/components/usb/test_apps/hcd/main/test_hcd_port.c @@ -30,7 +30,7 @@ Procedure: - Trigger the port disconnection event - Teardown port and HCD */ -TEST_CASE("Test HCD port disconnect event, port enabled", "[port][low_speed][full_speed]") +TEST_CASE("Test HCD port disconnect event, port enabled", "[port][low_speed][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection printf("Connected %s speed device \n", (char*[]) { @@ -63,7 +63,7 @@ Procedure: - Teardown port and HCD */ -TEST_CASE("Test HCD port sudden disconnect", "[port][low_speed][full_speed]") +TEST_CASE("Test HCD port sudden disconnect", "[port][low_speed][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) @@ -153,7 +153,7 @@ Procedure: - Cleanup default pipe - Trigger disconnection and teardown */ -TEST_CASE("Test HCD port suspend and resume", "[port][low_speed][full_speed]") +TEST_CASE("Test HCD port suspend and resume", "[port][low_speed][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) @@ -207,7 +207,7 @@ Procedure: - Check that a disconnection still works after disable - Teardown */ -TEST_CASE("Test HCD port disable", "[port][low_speed][full_speed]") +TEST_CASE("Test HCD port disable", "[port][low_speed][full_speed][high_speed]") { usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) @@ -295,7 +295,7 @@ static void concurrent_task(void *arg) vTaskDelay(portMAX_DELAY); // Block forever and wait to be deleted } -TEST_CASE("Test HCD port command bailout", "[port][low_speed][full_speed]") +TEST_CASE("Test HCD port command bailout", "[port][low_speed][full_speed][high_speed]") { test_hcd_wait_for_conn(port_hdl); // Trigger a connection vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) diff --git a/components/usb/test_apps/usb_host/main/test_usb_host_async.c b/components/usb/test_apps/usb_host/main/test_usb_host_async.c index 4c86a5b547..e691708670 100644 --- a/components/usb/test_apps/usb_host/main/test_usb_host_async.c +++ b/components/usb/test_apps/usb_host/main/test_usb_host_async.c @@ -181,7 +181,7 @@ static void test_async_client_cb(const usb_host_client_event_msg_t *event_msg, v } } -TEST_CASE("Test USB Host async API", "[usb_host][full_speed][low_speed]") +TEST_CASE("Test USB Host async API", "[usb_host][low_speed][full_speed][high_speed]") { // Register two clients client_test_stage_t client0_stage = CLIENT_TEST_STAGE_NONE; diff --git a/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c b/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c index 9273b1ad09..bca179c58e 100644 --- a/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c +++ b/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c @@ -33,7 +33,7 @@ Procedure: #define TEST_DCONN_NO_CLIENT_ITERATIONS 3 -TEST_CASE("Test USB Host sudden disconnection (no client)", "[usb_host][full_speed][low_speed]") +TEST_CASE("Test USB Host sudden disconnection (no client)", "[usb_host][low_speed][full_speed][high_speed]") { bool connected = false; int dconn_iter = 0; @@ -83,7 +83,7 @@ Procedure: #define TEST_FORCE_DCONN_NUM_TRANSFERS 3 #define TEST_MSC_SCSI_TAG 0xDEADBEEF -TEST_CASE("Test USB Host sudden disconnection (single client)", "[usb_host][full_speed]") +TEST_CASE("Test USB Host sudden disconnection (single client)", "[usb_host][full_speed][high_speed]") { // Create task to run client that communicates with MSC SCSI interface const dev_msc_info_t *dev_info = dev_msc_get_info(); @@ -132,7 +132,7 @@ Procedure: #define TEST_ENUM_ITERATIONS 3 -TEST_CASE("Test USB Host enumeration", "[usb_host][full_speed]") +TEST_CASE("Test USB Host enumeration", "[usb_host][full_speed][high_speed]") { // Create task to run client that checks the enumeration of the device TaskHandle_t task_hdl;