From 4a252c3f733f271bc0443009336f67db8cf7cfa2 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Wed, 14 Aug 2024 21:56:40 +0800 Subject: [PATCH] update: idf config update --- CMakeLists.txt | 6 +++--- idf_component.yml | 22 +++++++++++++++++++++- osal/idf/usb_config.h | 10 +--------- port/dwc2/usb_glue_esp.c | 1 + 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57fd38bd..1d4c5ace 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ set(CONFIG_CHERRYUSB_HOST_PL2303 1) set(CONFIG_CHERRYUSB_OSAL "freertos") set(CONFIG_CHERRYUSB_HOST_HCD "ehci_bouffalo") -include(cherryusb.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/cherryusb.cmake) sdk_generate_library(cherryusb) sdk_add_include_directories(${cherryusb_incs}) @@ -56,7 +56,7 @@ set(CONFIG_CHERRYUSB_HOST_BL616 1) set(CONFIG_CHERRYUSB_OSAL "freertos") set(CONFIG_CHERRYUSB_HOST_HCD "ehci_hpm") -include(cherryusb.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/cherryusb.cmake) sdk_inc(${cherryusb_incs}) sdk_src(${cherryusb_srcs}) @@ -69,7 +69,7 @@ set(CONFIG_CHERRYUSB_DEVICE_DCD "dwc2_esp") set(CONFIG_CHERRYUSB_HOST_HCD "dwc2_esp") set(CONFIG_CHERRYUSB_OSAL "idf") -include(cherryusb.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/cherryusb.cmake) set(ldfragments "osal/idf/linker.lf") diff --git a/idf_component.yml b/idf_component.yml index 8f80c12c..9d1014f0 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,5 +1,25 @@ +version: "1.4.0" description: CherryUSB is a tiny and portable USB Stack (device & host) for embedded system with USB IP +tags: + - usb + - usb-device + - usb-host + - cdc_acm + - cdc_ecm + - cdc_ncm + - hid + - msc + - rndis + - uvc + - uac + - winusb url: https://github.com/cherry-embedded/CherryUSB repository: https://github.com/cherry-embedded/CherryUSB.git documentation: https://cherryusb.readthedocs.io/ -issues: https://github.com/cherry-embedded/CherryUSB/issues \ No newline at end of file +issues: https://github.com/cherry-embedded/CherryUSB/issues +dependencies: + idf: ">=5.0" +targets: + - esp32s2 + - esp32s3 + - esp32p4 \ No newline at end of file diff --git a/osal/idf/usb_config.h b/osal/idf/usb_config.h index e813c920..d761a924 100644 --- a/osal/idf/usb_config.h +++ b/osal/idf/usb_config.h @@ -16,9 +16,6 @@ #define CONFIG_USB_PRINTF(...) esp_rom_printf(__VA_ARGS__) -#define usb_malloc(size) malloc(size) -#define usb_free(ptr) free(ptr) - #ifndef CONFIG_USB_DBG_LEVEL #define CONFIG_USB_DBG_LEVEL USB_DBG_INFO #endif @@ -103,14 +100,10 @@ #define CONFIG_USBDEV_RNDIS_VENDOR_DESC "CherryUSB" #endif -/****** #define CONFIG_USBDEV_RNDIS_USING_LWIP -******/ /* ================ USB HOST Stack Configuration ================== */ -// NOTE: Below configurations are removed to Kconfig, `idf.py menuconfig` to config them -/****** #define CONFIG_USBHOST_MAX_RHPORTS 1 #define CONFIG_USBHOST_MAX_EXTHUBS 1 #define CONFIG_USBHOST_MAX_EHPORTS 4 @@ -125,7 +118,6 @@ #define CONFIG_USBHOST_MAX_VIDEO_CLASS 1 #define CONFIG_USBHOST_DEV_NAMELEN 16 -******/ #ifndef CONFIG_USBHOST_PSC_PRIO #define CONFIG_USBHOST_PSC_PRIO 0 @@ -143,7 +135,7 @@ /* Ep0 max transfer buffer */ #ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN -#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 2048 #endif #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT diff --git a/port/dwc2/usb_glue_esp.c b/port/dwc2/usb_glue_esp.c index 4cebcee4..c62c46c5 100644 --- a/port/dwc2/usb_glue_esp.c +++ b/port/dwc2/usb_glue_esp.c @@ -8,6 +8,7 @@ #include "esp_intr_alloc.h" #include "esp_private/usb_phy.h" #include "soc/periph_defs.h" +#include "freertos/FreeRTOS.h" #include "usbd_core.h" #include "usbh_core.h"