mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(usb/host): Enable USB Host tests on P4
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user