Add initial support for USB MSC (#5466)
* Add initial support for USB MSC * Add Firmware Upload/Download With MSC Current running firmware is available as file inside the MSC Disk. To update the firmware on the ESP, just copy a regular firmware bin into the drive * Support overwriting of the firmware file Overwriting a file is done totally differently on MacOS, Windows and Linux. This change supports it on all of them. * Allow CDC, FirmwareMSC and DFU to be enabled on boot * Add example ESP32-S2 USB-ONLY board * Various device code optimizations Added `end()` methods to MSC classes Made begin() methods safe to be called multiple times Optimized CDC class * Fix CDC Connect/Disconnect detection in Arduino IDE on Windows * Rework cdc_write * Update ESP32-S2 board configs
This commit is contained in:
parent
be84c8219c
commit
5bb8177aa1
@ -34,6 +34,9 @@ set(CORE_SRCS
|
||||
cores/esp32/StreamString.cpp
|
||||
cores/esp32/USB.cpp
|
||||
cores/esp32/USBCDC.cpp
|
||||
cores/esp32/USBMSC.cpp
|
||||
cores/esp32/FirmwareMSC.cpp
|
||||
cores/esp32/firmware_msc_fat.c
|
||||
cores/esp32/wiring_pulse.c
|
||||
cores/esp32/wiring_shift.c
|
||||
cores/esp32/WMath.cpp
|
||||
@ -151,6 +154,7 @@ set(includedirs
|
||||
libraries/SPI/src
|
||||
libraries/Ticker/src
|
||||
libraries/Update/src
|
||||
libraries/USB/src
|
||||
libraries/WebServer/src
|
||||
libraries/WiFiClientSecure/src
|
||||
libraries/WiFi/src
|
||||
|
||||
303
boards.txt
303
boards.txt
@ -1,5 +1,7 @@
|
||||
menu.UploadSpeed=Upload Speed
|
||||
menu.SerialMode=Serial Connected To
|
||||
menu.CDCOnBoot=USB CDC On Boot
|
||||
menu.MSCOnBoot=USB Firmware MSC On Boot
|
||||
menu.DFUOnBoot=USB DFU On Boot
|
||||
menu.UploadMode=Upload Mode
|
||||
menu.CPUFreq=CPU Frequency
|
||||
menu.FlashFreq=Flash Frequency
|
||||
@ -37,7 +39,7 @@ esp32c3.build.variant=esp32c3
|
||||
esp32c3.build.board=ESP32C3_DEV
|
||||
esp32c3.build.bootloader_addr=0x0
|
||||
|
||||
esp32c3.build.serial=0
|
||||
esp32c3.build.cdc_on_boot=0
|
||||
esp32c3.build.f_cpu=160000000L
|
||||
esp32c3.build.flash_size=4MB
|
||||
esp32c3.build.flash_freq=80m
|
||||
@ -173,19 +175,31 @@ esp32s2.build.core=esp32
|
||||
esp32s2.build.variant=esp32s2
|
||||
esp32s2.build.board=ESP32S2_DEV
|
||||
|
||||
esp32s2.build.serial=0
|
||||
esp32s2.build.cdc_on_boot=0
|
||||
esp32s2.build.msc_on_boot=0
|
||||
esp32s2.build.dfu_on_boot=0
|
||||
esp32s2.build.f_cpu=240000000L
|
||||
esp32s2.build.flash_size=4MB
|
||||
esp32s2.build.flash_freq=80m
|
||||
esp32s2.build.flash_mode=qio
|
||||
esp32s2.build.flash_mode=dio
|
||||
esp32s2.build.boot=qio
|
||||
esp32s2.build.partitions=default
|
||||
esp32s2.build.defines=
|
||||
|
||||
esp32s2.menu.SerialMode.default=UART0
|
||||
esp32s2.menu.SerialMode.default.build.serial=0
|
||||
esp32s2.menu.SerialMode.cdc=USB CDC
|
||||
esp32s2.menu.SerialMode.cdc.build.serial=1
|
||||
esp32s2.menu.CDCOnBoot.default=Disabled
|
||||
esp32s2.menu.CDCOnBoot.default.build.cdc_on_boot=0
|
||||
esp32s2.menu.CDCOnBoot.cdc=Enabled
|
||||
esp32s2.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
|
||||
|
||||
esp32s2.menu.MSCOnBoot.default=Disabled
|
||||
esp32s2.menu.MSCOnBoot.default.build.msc_on_boot=0
|
||||
esp32s2.menu.MSCOnBoot.msc=Enabled
|
||||
esp32s2.menu.MSCOnBoot.msc.build.msc_on_boot=1
|
||||
|
||||
esp32s2.menu.DFUOnBoot.default=Disabled
|
||||
esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0
|
||||
esp32s2.menu.DFUOnBoot.dfu=Enabled
|
||||
esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
|
||||