Thanks for Posting the sample code! But I'm getting this error message when I tried to compile the SD_MSC example.
Arduino: 1.8.13 (Windows 10), Board: "ESP32S2 Dev Module, UART0, Disabled, Default 4MB with ffat (1.2MB APP/1.5MB FATFS), 240MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 921600, None"
In file included from C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/tusb.h:65,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src/usb_descriptors.h:17,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src/esptinyusb.h:3,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\cdc\cdcusb.cpp:3:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\cdc\cdcusb.cpp: In member function 'bool CDCusb::begin(char*)':
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\cdc\cdcusb.cpp:26:73: warning: narrowing conversion of '(128 | (((int)((CDCusb*)this)->CDCusb::_EPNUM_CDC) - 1))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
uint8_t cdc[TUD_CDC_DESC_LEN] = {TUD_CDC_DESCRIPTOR(ifIdx, 4, (0x80 | (_EPNUM_CDC - 1)), 8, _EPNUM_CDC, 0x80 | _EPNUM_CDC, 64)};
~~~~~~^~~~~~~~~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/device/usbd.h:203:26: note: in definition of macro 'TUD_CDC_DESCRIPTOR'
7, TUSB_DESC_ENDPOINT, _ep_notif, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_notif_size), 16,\
^~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\cdc\cdcusb.cpp:26:114: warning: narrowing conversion of '(int)(128 | ((unsigned char)((int)((CDCusb*)this)->CDCusb::_EPNUM_CDC)))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
uint8_t cdc[TUD_CDC_DESC_LEN] = {TUD_CDC_DESCRIPTOR(ifIdx, 4, (0x80 | (_EPNUM_CDC - 1)), 8, _EPNUM_CDC, 0x80 | _EPNUM_CDC, 64)};
~~~~~^~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/device/usbd.h:209:26: note: in definition of macro 'TUD_CDC_DESCRIPTOR'
7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
^~~~~
In file included from C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/tusb.h:65,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\hid\hidgeneric.cpp:2:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\hid\hidgeneric.cpp: In member function 'virtual bool HIDgeneric::begin(char*)':
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\hid\hidgeneric.cpp:19:118: warning: narrowing conversion of '(int)(128 | ((unsigned char)((int)((HIDgeneric*)this)->HIDgeneric::<anonymous>.HIDusb::_EPNUM_HID)))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
uint8_t hid[] = {TUD_HID_INOUT_DESCRIPTOR(ifIdx++, 0, HID_PROTOCOL_NONE, sizeof(desc_hid_report), _EPNUM_HID, 0x80 | _EPNUM_HID, CFG_TUD_HID_BUFSIZE, 10)};
~~~~~^~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/device/usbd.h:253:26: note: in definition of macro 'TUD_HID_INOUT_DESCRIPTOR'
7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_epsize), _ep_interval
^~~~~
In file included from C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/tusb.h:65,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\midi\midiusb.cpp:2:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\midi\midiusb.cpp: In member function 'bool MIDIusb::begin(char*)':
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\midi\midiusb.cpp:22:67: warning: narrowing conversion of '(int)(128 | ((unsigned char)((int)((MIDIusb*)this)->MIDIusb::_EPNUM_MIDI)))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
uint8_t midi[] = {TUD_MIDI_DESCRIPTOR(1, 8, _EPNUM_MIDI, 0x80 | _EPNUM_MIDI, 64)};
~~~~~^~~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/device/usbd.h:294:26: note: in definition of macro 'TUD_MIDI_DESC_EP'
7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
^~~~~~
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\midi\midiusb.cpp:22:23: note: in expansion of macro 'TUD_MIDI_DESCRIPTOR'
uint8_t midi[] = {TUD_MIDI_DESCRIPTOR(1, 8, _EPNUM_MIDI, 0x80 | _EPNUM_MIDI, 64)};
^~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/tusb.h:65,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\msc\mscusb.cpp:2:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\msc\mscusb.cpp: In member function 'bool MSCusb::begin(char*)':
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\msc\mscusb.cpp:16:70: warning: narrowing conversion of '(int)(128 | ((unsigned char)((int)((MSCusb*)this)->MSCusb::_EPNUM_MSC)))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
uint8_t msc[] = {TUD_MSC_DESCRIPTOR(ifIdx++, 5, _EPNUM_MSC, 0x80 | _EPNUM_MSC, 64)}; // highspeed 512
~~~~~^~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/device/usbd.h:223:26: note: in definition of macro 'TUD_MSC_DESCRIPTOR'
7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
^~~~~
In file included from C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/tusb.h:65,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src/usb_descriptors.h:17,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src/esptinyusb.h:3,
from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp:3:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp: In member function 'bool WebUSB::begin(char*, const char*, bool)':
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp:73:79: warning: narrowing conversion of '(int)(128 | ((unsigned char)((int)((WebUSB*)this)->WebUSB::_EPNUM_VENDOR)))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
uint8_t vendor[] = {TUD_VENDOR_DESCRIPTOR(ifIdx++, 7, _EPNUM_VENDOR, 0x80 | _EPNUM_VENDOR, 64)};
~~~~~^~~~~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/device/usbd.h:527:26: note: in definition of macro 'TUD_VENDOR_DESCRIPTOR'
7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
^~~~~
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp: At global scope:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp:217:10: error: conflicting declaration of 'bool tud_vendor_control_request_cb(uint8_t, const tusb_control_request_t*)' with 'C' linkage
bool tud_vendor_control_request_cb(uint8_t rhport, tusb_control_request_t const *request)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp:4:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src/webusb.h:34:15: note: previous declaration with 'C++' linkage
friend bool tud_vendor_control_request_cb(uint8_t rhport, tusb_control_request_t const *request);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp:264:10: error: conflicting declaration of 'bool tud_vendor_control_complete_cb(uint8_t, const tusb_control_request_t*)' with 'C' linkage
bool tud_vendor_control_complete_cb(uint8_t rhport, tusb_control_request_t const *request)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src\classes\web\webusb.cpp:4:
C:\Users\Henry Wang\Documents\Arduino\libraries\EspTinyUSB\src/webusb.h:35:15: note: previous declaration with 'C++' linkage
friend bool tud_vendor_control_complete_cb(uint8_t rhport, tusb_control_request_t const *request);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "SD.h"
Used: C:\Users\Henry Wang\Documents\Arduino\hardware\espressif\esp32\libraries\SD
Not used: C:\Program Files (x86)\Arduino\libraries\SD
exit status 1
Error compiling for board ESP32S2 Dev Module.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.