From 708170505632fa1ac76ec4e6cce84032ca015087 Mon Sep 17 00:00:00 2001 From: rechrtb Date: Thu, 25 Apr 2024 18:44:32 +0800 Subject: [PATCH 1/2] Add tinyUSB configuration for host mass storage --- src/tusb_config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tusb_config.h b/src/tusb_config.h index ef71d48..6ceed36 100644 --- a/src/tusb_config.h +++ b/src/tusb_config.h @@ -56,8 +56,12 @@ # endif #endif +# if (CFG_TUSB_MCU == OPT_MCU_SAME5X) //#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED) #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE) +# elif (CFG_TUSB_MCU == OPT_MCU_SAMX7X) +#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HOST) +#endif #ifndef CFG_TUSB_OS # define CFG_TUSB_OS OPT_OS_FREERTOS @@ -83,6 +87,12 @@ #define CFG_TUD_MIDI (0) #define CFG_TUD_VENDOR (0) +#define CFG_TUH_ENUMERATION_BUFSIZE 256 +#define CFG_TUH_HUB (1) +#define CFG_TUH_MSC (1) +#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 2 : 1) +#define CFG_TUH_MSC_MAXLUN 1 + // CDC FIFO size of TX and RX #define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 128) #define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 128) From a7266092925abf12b8748c699ea2e2e91b282cf6 Mon Sep 17 00:00:00 2001 From: rechrtb Date: Mon, 29 Apr 2024 20:51:23 +0800 Subject: [PATCH 2/2] Support SAME51 in config --- src/tusb_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tusb_config.h b/src/tusb_config.h index 6ceed36..9f00af6 100644 --- a/src/tusb_config.h +++ b/src/tusb_config.h @@ -43,7 +43,7 @@ */ #ifndef CFG_TUSB_MCU -# if defined(__SAME54P20A__) +# if defined(__SAME54P20A__) || defined(__SAME51N19A__) # define CFG_TUSB_MCU OPT_MCU_SAME5X # define CFG_TUSB_MEM_SECTION /* nothing */ # define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))