get hcd work esp32p4 but only in slave mode. In DMA channel's HCDMA is increased but data transfer over USB is not correct.

This commit is contained in:
hathach
2024-11-08 17:23:43 +07:00
parent ab8160a29b
commit 5d00488907
6 changed files with 34 additions and 6 deletions

View File

@@ -179,8 +179,10 @@ bool usb_init(void) {
// maybe we can use USB_OTG_MODE_DEFAULT and switch using dwc2 driver
#if CFG_TUD_ENABLED
.otg_mode = USB_OTG_MODE_DEVICE,
.otg_speed = BOARD_TUD_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
#elif CFG_TUH_ENABLED
.otg_mode = USB_OTG_MODE_HOST,
.otg_speed= BOARD_TUH_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
#endif
};

View File

@@ -10,9 +10,15 @@ set(RHPORT_SPEED OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED)
if (NOT DEFINED RHPORT_DEVICE)
if (IDF_TARGET STREQUAL "esp32p4")
set(RHPORT_DEVICE 1)
set(RHPORT_HOST 1)
else ()
set(RHPORT_DEVICE 0)
endif ()
endif()
if (NOT DEFINED RHPORT_HOST)
if (IDF_TARGET STREQUAL "esp32p4")
set(RHPORT_HOST 1)
else ()
set(RHPORT_HOST 0)
endif ()
endif()