hcd work with esp32p4 in slave mode but have issue with DMA mode. In slave it enumerate device but has issue with msc bulk in
This commit is contained in:
@@ -175,7 +175,13 @@ bool usb_init(void) {
|
||||
usb_phy_config_t phy_conf = {
|
||||
.controller = USB_PHY_CTRL_OTG,
|
||||
.target = USB_PHY_TARGET_INT,
|
||||
|
||||
// maybe we can use USB_OTG_MODE_DEFAULT and switch using dwc2 driver
|
||||
#if CFG_TUD_ENABLED
|
||||
.otg_mode = USB_OTG_MODE_DEVICE,
|
||||
#elif CFG_TUH_ENABLED
|
||||
.otg_mode = USB_OTG_MODE_HOST,
|
||||
#endif
|
||||
};
|
||||
|
||||
// OTG IOs config
|
||||
|
@@ -9,9 +9,10 @@ string(TOUPPER OPT_MCU_${target} tusb_mcu)
|
||||
list(APPEND compile_definitions
|
||||
CFG_TUSB_MCU=${tusb_mcu}
|
||||
CFG_TUSB_OS=OPT_OS_FREERTOS
|
||||
# EXAMPLE port selection: port0 is fullspeed, port1 is highspeed
|
||||
BOARD_TUD_RHPORT=${TUD_PORT}
|
||||
BOARD_TUD_MAX_SPEED=$<IF:${TUD_PORT},OPT_MODE_HIGH_SPEED,OPT_MODE_FULL_SPEED>
|
||||
BOARD_TUD_RHPORT=${RHPORT_DEVICE}
|
||||
BOARD_TUD_MAX_SPEED=${RHPORT_DEVICE_SPEED}
|
||||
BOARD_TUH_RHPORT=${RHPORT_HOST}
|
||||
BOARD_TUH_MAX_SPEED=${RHPORT_HOST_SPEED}
|
||||
)
|
||||
|
||||
list(APPEND srcs
|
||||
|
@@ -5,14 +5,25 @@ include("${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake")
|
||||
string(TOUPPER ${IDF_TARGET} FAMILY_MCUS)
|
||||
|
||||
# Device port default to Port1 for P4 (highspeed), Port0 for others (fullspeed)
|
||||
if (NOT DEFINED TUD_PORT)
|
||||
set(RHPORT_SPEED OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED)
|
||||
|
||||
if (NOT DEFINED RHPORT_DEVICE)
|
||||
if (IDF_TARGET STREQUAL "esp32p4")
|
||||
set(TUD_PORT 1)
|
||||
set(RHPORT_DEVICE 1)
|
||||
set(RHPORT_HOST 1)
|
||||
else ()
|
||||
set(TUD_PORT 0)
|
||||
set(RHPORT_DEVICE 0)
|
||||
set(RHPORT_HOST 0)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED RHPORT_DEVICE_SPEED)
|
||||
list(GET RHPORT_SPEED ${RHPORT_DEVICE} RHPORT_DEVICE_SPEED)
|
||||
endif ()
|
||||
if (NOT DEFINED RHPORT_HOST_SPEED)
|
||||
list(GET RHPORT_SPEED ${RHPORT_HOST} RHPORT_HOST_SPEED)
|
||||
endif ()
|
||||
|
||||
# Add example src and bsp directories
|
||||
set(EXTRA_COMPONENT_DIRS "src" "${CMAKE_CURRENT_LIST_DIR}/boards" "${CMAKE_CURRENT_LIST_DIR}/components")
|
||||
|
||||
|
Reference in New Issue
Block a user