mirror of https://github.com/ARMmbed/mbed-os.git
USB basic test update
disable suspend/resume test disable sync frame test improve reset testpull/9768/head
parent
21606569da
commit
fee14771e9
|
@ -313,7 +313,6 @@ def control_basic_test(dev, vendor_id, product_id, log):
|
||||||
set_clear_feature_test(dev, log)
|
set_clear_feature_test(dev, log)
|
||||||
get_descriptor_test(dev, vendor_id, product_id, log)
|
get_descriptor_test(dev, vendor_id, product_id, log)
|
||||||
set_descriptor_test(dev, log)
|
set_descriptor_test(dev, log)
|
||||||
#synch_frame_test(dev, log) wait for isochronous endpoint
|
|
||||||
|
|
||||||
|
|
||||||
def get_set_configuration_test(dev, log):
|
def get_set_configuration_test(dev, log):
|
||||||
|
@ -738,8 +737,12 @@ def device_reset_test(log):
|
||||||
dev = yield
|
dev = yield
|
||||||
dev.reset();
|
dev.reset();
|
||||||
dev = yield
|
dev = yield
|
||||||
|
# run other test to check if USB works fine after reset
|
||||||
|
control_data_test(dev, [64, 256], log)
|
||||||
dev.reset();
|
dev.reset();
|
||||||
dev = yield
|
dev = yield
|
||||||
|
# run other test to check if USB works fine after reset
|
||||||
|
control_data_test(dev, [64, 256], log)
|
||||||
dev.reset();
|
dev.reset();
|
||||||
dev = yield
|
dev = yield
|
||||||
# run other test to check if USB works fine after reset
|
# run other test to check if USB works fine after reset
|
||||||
|
@ -769,15 +772,25 @@ def device_soft_reconnection_test(log):
|
||||||
|
|
||||||
def device_suspend_resume_test(log):
|
def device_suspend_resume_test(log):
|
||||||
dev = yield
|
dev = yield
|
||||||
time.sleep(0.1)
|
|
||||||
control_data_test(dev, [64, 256], log)
|
control_data_test(dev, [64, 256], log)
|
||||||
time.sleep(0.1)
|
# suspend code goes here
|
||||||
|
# ...
|
||||||
|
# resume code here
|
||||||
|
# ...
|
||||||
|
# run other test to check if USB works fine after resume
|
||||||
control_data_test(dev, [64, 256], log)
|
control_data_test(dev, [64, 256], log)
|
||||||
time.sleep(0.1)
|
# suspend code here
|
||||||
|
# ...
|
||||||
|
# resume code here
|
||||||
|
# ...
|
||||||
|
# run other test to check if USB works fine after resume
|
||||||
control_data_test(dev, [64, 256], log)
|
control_data_test(dev, [64, 256], log)
|
||||||
time.sleep(0.1)
|
# suspend code here
|
||||||
|
# ...
|
||||||
|
# resume code here
|
||||||
|
# ...
|
||||||
|
# run other test to check if USB works fine after resume
|
||||||
control_data_test(dev, [64, 256], log)
|
control_data_test(dev, [64, 256], log)
|
||||||
time.sleep(0.1)
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
#include "USBTester.h"
|
#include "USBTester.h"
|
||||||
#include "usb_phy_api.h"
|
#include "usb_phy_api.h"
|
||||||
|
|
||||||
|
// Uncomment or remove this if host suspend_resume_test part will be implemented
|
||||||
|
//#define SUSPEND_RESUME_TEST_SUPPORTED
|
||||||
|
|
||||||
// If disconnect() + connect() occur too fast the reset event will be dropped.
|
// If disconnect() + connect() occur too fast the reset event will be dropped.
|
||||||
// At a minimum there should be a 200us delay between disconnect and connect.
|
// At a minimum there should be a 200us delay between disconnect and connect.
|
||||||
// To be on the safe side I would recommend a 1ms delay, so the host controller
|
// To be on the safe side I would recommend a 1ms delay, so the host controller
|
||||||
|
@ -202,6 +205,7 @@ void device_soft_reconnection_test()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SUSPEND_RESUME_TEST_SUPPORTED
|
||||||
void device_suspend_resume_test()
|
void device_suspend_resume_test()
|
||||||
{
|
{
|
||||||
uint16_t vendor_id = 0x0d28;
|
uint16_t vendor_id = 0x0d28;
|
||||||
|
@ -224,6 +228,7 @@ void device_suspend_resume_test()
|
||||||
printf("[3] suspend_count: %d resume_count: %d\n", serial.get_suspend_count(), serial.get_resume_count());
|
printf("[3] suspend_count: %d resume_count: %d\n", serial.get_suspend_count(), serial.get_resume_count());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void repeated_construction_destruction_test()
|
void repeated_construction_destruction_test()
|
||||||
{
|
{
|
||||||
|
@ -288,7 +293,9 @@ Case cases[] = {
|
||||||
Case("usb control stress test", control_stress_test),
|
Case("usb control stress test", control_stress_test),
|
||||||
Case("usb device reset test", device_reset_test),
|
Case("usb device reset test", device_reset_test),
|
||||||
Case("usb soft reconnection test", device_soft_reconnection_test),
|
Case("usb soft reconnection test", device_soft_reconnection_test),
|
||||||
|
#if SUSPEND_RESUME_TEST_SUPPORTED
|
||||||
Case("usb device suspend/resume test", device_suspend_resume_test),
|
Case("usb device suspend/resume test", device_suspend_resume_test),
|
||||||
|
#endif
|
||||||
Case("usb repeated construction destruction test", repeated_construction_destruction_test)
|
Case("usb repeated construction destruction test", repeated_construction_destruction_test)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue