diff --git a/components/arduino_tinyusb/CMakeLists.txt b/components/arduino_tinyusb/CMakeLists.txt index 041eeec0f..02f9187f1 100755 --- a/components/arduino_tinyusb/CMakeLists.txt +++ b/components/arduino_tinyusb/CMakeLists.txt @@ -43,6 +43,7 @@ if(CONFIG_TINYUSB_ENABLED) "${COMPONENT_DIR}/tinyusb/src/class/msc/msc_device.c" "${COMPONENT_DIR}/tinyusb/src/class/video/video_device.c" "${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_rt_device.c" + "${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_device.c" "${COMPONENT_DIR}/tinyusb/src/class/vendor/vendor_device.c" "${COMPONENT_DIR}/tinyusb/src/common/tusb_fifo.c" "${COMPONENT_DIR}/tinyusb/src/device/usbd_control.c" diff --git a/components/arduino_tinyusb/Kconfig.projbuild b/components/arduino_tinyusb/Kconfig.projbuild index a6abd4d8a..80983657f 100755 --- a/components/arduino_tinyusb/Kconfig.projbuild +++ b/components/arduino_tinyusb/Kconfig.projbuild @@ -175,6 +175,31 @@ menu "Arduino TinyUSB" endmenu + menu "DFU driver" + depends on TINYUSB_ENABLED + + config TINYUSB_DFU_ENABLED + bool "Enable USB DFU TinyUSB driver" + default y + help + Enable USB DFU TinyUSB driver. + + config TINYUSB_DESC_DFU_STRING + string "DFU Device String" + default "Espressif DFU Device" + depends on TINYUSB_DFU_ENABLED + help + Specify name of the DFU device + + config TINYUSB_DFU_BUFSIZE + int "DFU buffer size" + default 4096 + depends on TINYUSB_DFU_ENABLED + help + DFU buffer size + + endmenu + menu "VENDOR driver" depends on TINYUSB_ENABLED diff --git a/components/arduino_tinyusb/include/tusb_config.h b/components/arduino_tinyusb/include/tusb_config.h index a5a0afd32..ee1e5d270 100755 --- a/components/arduino_tinyusb/include/tusb_config.h +++ b/components/arduino_tinyusb/include/tusb_config.h @@ -64,6 +64,10 @@ extern "C" { # define CONFIG_TINYUSB_DFU_RT_ENABLED 0 #endif +#ifndef CONFIG_TINYUSB_DFU_ENABLED +# define CONFIG_TINYUSB_DFU_ENABLED 0 +#endif + #ifndef CONFIG_TINYUSB_VENDOR_ENABLED # define CONFIG_TINYUSB_VENDOR_ENABLED 0 #endif @@ -106,6 +110,7 @@ extern "C" { #define CFG_TUD_VIDEO CONFIG_TINYUSB_VIDEO_ENABLED #define CFG_TUD_CUSTOM_CLASS CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED #define CFG_TUD_DFU_RUNTIME CONFIG_TINYUSB_DFU_RT_ENABLED +#define CFG_TUD_DFU CONFIG_TINYUSB_DFU_ENABLED #define CFG_TUD_VENDOR CONFIG_TINYUSB_VENDOR_ENABLED // CDC FIFO size of TX and RX @@ -126,6 +131,9 @@ extern "C" { #define CFG_TUD_VIDEO_STREAMING CONFIG_TINYUSB_VIDEO_STREAMING_IFS #define CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE CONFIG_TINYUSB_VIDEO_STREAMING_BUFSIZE +// DFU buffer size +#define CFG_TUD_DFU_XFER_BUFSIZE CONFIG_TINYUSB_DFU_BUFSIZE + // VENDOR FIFO size of TX and RX #define CFG_TUD_VENDOR_RX_BUFSIZE CONFIG_TINYUSB_VENDOR_RX_BUFSIZE #define CFG_TUD_VENDOR_TX_BUFSIZE CONFIG_TINYUSB_VENDOR_TX_BUFSIZE