diff --git a/hw/bsp/espressif/boards/espressif_p4_function_ev/board.h b/hw/bsp/espressif/boards/espressif_p4_function_ev/board.h index 9c8aa409f2..0022f0d2df 100644 --- a/hw/bsp/espressif/boards/espressif_p4_function_ev/board.h +++ b/hw/bsp/espressif/boards/espressif_p4_function_ev/board.h @@ -36,6 +36,10 @@ #define BUTTON_PIN 0 #define BUTTON_STATE_ACTIVE 0 +// For CI hardware test, to test both device and host on the same HS port with help of +#define HIL_DEVICE_HOST_MUX_PIN 47 +#define HIL_DEVICE_STATE 1 + #ifdef __cplusplus } #endif diff --git a/hw/bsp/espressif/boards/family.c b/hw/bsp/espressif/boards/family.c index 0b1e8badbd..729b3539d2 100644 --- a/hw/bsp/espressif/boards/family.c +++ b/hw/bsp/espressif/boards/family.c @@ -105,6 +105,12 @@ void board_init(void) { usb_init(); #endif +#ifdef HIL_DEVICE_HOST_MUX_PIN + gpio_reset_pin(HIL_DEVICE_HOST_MUX_PIN); + gpio_set_direction(HIL_DEVICE_HOST_MUX_PIN, GPIO_MODE_OUTPUT); + gpio_set_level(HIL_DEVICE_HOST_MUX_PIN, CFG_TUD_ENABLED ? HIL_DEVICE_STATE : (1-HIL_DEVICE_STATE)); +#endif + #if CFG_TUH_ENABLED && CFG_TUH_MAX3421 max3421_init(); #endif diff --git a/test/hil/tinyusb.json b/test/hil/tinyusb.json index 2313f5d13c..c92224e26d 100644 --- a/test/hil/tinyusb.json +++ b/test/hil/tinyusb.json @@ -1,5 +1,18 @@ { "boards": [ + { + "name": "espressif_p4_function_ev", + "uid": "6055F9F98715", + "build" : { + "flags_on": ["", "CFG_TUD_DWC2_DMA"] + }, + "tests": { + "only": ["device/cdc_msc_freertos", "device/hid_composite_freertos"] + }, + "flasher": "esptool", + "flasher_sn": "4ea4f48f6bc3ee11bbb9d00f9e1b1c54", + "flasher_args": "-b 1500000" + }, { "name": "espressif_s3_devkitm", "uid": "84F703C084E4",