Skip to content

Commit 5747bfa

Browse files
2 parents 0f174aa + 4b9dc61 commit 5747bfa

File tree

1,765 files changed

+112265
-54489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,765 files changed

+112265
-54489
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ boards.sloeber.txt
2121

2222
# Ignore docs build (Sphinx)
2323
docs/build
24+
docs/source/_build

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set(CORE_SRCS
77
cores/esp32/esp32-hal-dac.c
88
cores/esp32/esp32-hal-gpio.c
99
cores/esp32/esp32-hal-i2c.c
10+
cores/esp32/esp32-hal-i2c-slave.c
1011
cores/esp32/esp32-hal-ledc.c
1112
cores/esp32/esp32-hal-matrix.c
1213
cores/esp32/esp32-hal-misc.c
@@ -54,6 +55,7 @@ set(LIBRARY_SRCS
5455
libraries/DNSServer/src/DNSServer.cpp
5556
libraries/EEPROM/src/EEPROM.cpp
5657
libraries/ESPmDNS/src/ESPmDNS.cpp
58+
libraries/Ethernet/src/ETH.cpp
5759
libraries/FFat/src/FFat.cpp
5860
libraries/FS/src/FS.cpp
5961
libraries/FS/src/vfs_api.cpp
@@ -90,7 +92,6 @@ set(LIBRARY_SRCS
9092
libraries/WebServer/src/detail/mimetable.cpp
9193
libraries/WiFiClientSecure/src/ssl_client.cpp
9294
libraries/WiFiClientSecure/src/WiFiClientSecure.cpp
93-
libraries/WiFi/src/ETH.cpp
9495
libraries/WiFi/src/WiFiAP.cpp
9596
libraries/WiFi/src/WiFiClient.cpp
9697
libraries/WiFi/src/WiFi.cpp
@@ -174,7 +175,7 @@ set(includedirs
174175
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
175176
set(priv_includes cores/esp32/libb64)
176177
set(requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp)
177-
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc)
178+
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc esp_hid)
178179

179180
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
180181

boards.txt

+167-17
Original file line numberDiff line numberDiff line change
@@ -2064,6 +2064,122 @@ ttgo-t7-v14-mini32.menu.DebugLevel.verbose.build.code_debug=5
20642064

20652065
##############################################################
20662066

2067+
ttgo-t-oi-plus.name=TTGO T-OI PLUS RISC-V ESP32-C3
2068+
2069+
ttgo-t-oi-plus.upload.tool=esptool_py
2070+
ttgo-t-oi-plus.upload.maximum_size=1310720
2071+
ttgo-t-oi-plus.upload.maximum_data_size=327680
2072+
ttgo-t-oi-plus.upload.flags=
2073+
ttgo-t-oi-plus.upload.extra_flags=
2074+
2075+
ttgo-t-oi-plus.serial.disableDTR=false
2076+
ttgo-t-oi-plus.serial.disableRTS=false
2077+
2078+
ttgo-t-oi-plus.build.tarch=riscv32
2079+
ttgo-t-oi-plus.build.target=esp
2080+
ttgo-t-oi-plus.build.mcu=esp32c3
2081+
ttgo-t-oi-plus.build.core=esp32
2082+
ttgo-t-oi-plus.build.variant=ttgo-t-oi-plus
2083+
ttgo-t-oi-plus.build.board=TTGO-T-OI-PLUS_DEV
2084+
ttgo-t-oi-plus.build.bootloader_addr=0x0
2085+
2086+
ttgo-t-oi-plus.build.cdc_on_boot=0
2087+
ttgo-t-oi-plus.build.f_cpu=160000000L
2088+
ttgo-t-oi-plus.build.flash_size=4MB
2089+
ttgo-t-oi-plus.build.flash_freq=80m
2090+
ttgo-t-oi-plus.build.flash_mode=qio
2091+
ttgo-t-oi-plus.build.boot=qio
2092+
ttgo-t-oi-plus.build.partitions=default
2093+
ttgo-t-oi-plus.build.defines=
2094+
2095+
ttgo-t-oi-plus.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
2096+
ttgo-t-oi-plus.menu.PartitionScheme.default.build.partitions=default
2097+
ttgo-t-oi-plus.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
2098+
ttgo-t-oi-plus.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
2099+
ttgo-t-oi-plus.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
2100+
ttgo-t-oi-plus.menu.PartitionScheme.minimal.build.partitions=minimal
2101+
ttgo-t-oi-plus.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
2102+
ttgo-t-oi-plus.menu.PartitionScheme.no_ota.build.partitions=no_ota
2103+
ttgo-t-oi-plus.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
2104+
ttgo-t-oi-plus.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
2105+
ttgo-t-oi-plus.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
2106+
ttgo-t-oi-plus.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
2107+
ttgo-t-oi-plus.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
2108+
ttgo-t-oi-plus.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
2109+
ttgo-t-oi-plus.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
2110+
ttgo-t-oi-plus.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
2111+
ttgo-t-oi-plus.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
2112+
ttgo-t-oi-plus.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
2113+
ttgo-t-oi-plus.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
2114+
ttgo-t-oi-plus.menu.PartitionScheme.huge_app.build.partitions=huge_app
2115+
ttgo-t-oi-plus.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
2116+
ttgo-t-oi-plus.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
2117+
ttgo-t-oi-plus.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
2118+
ttgo-t-oi-plus.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
2119+
2120+
2121+
ttgo-t-oi-plus.menu.CPUFreq.160=160MHz (WiFi)
2122+
ttgo-t-oi-plus.menu.CPUFreq.160.build.f_cpu=160000000L
2123+
ttgo-t-oi-plus.menu.CPUFreq.80=80MHz (WiFi)
2124+
ttgo-t-oi-plus.menu.CPUFreq.80.build.f_cpu=80000000L
2125+
ttgo-t-oi-plus.menu.CPUFreq.40=40MHz
2126+
ttgo-t-oi-plus.menu.CPUFreq.40.build.f_cpu=40000000L
2127+
ttgo-t-oi-plus.menu.CPUFreq.20=20MHz
2128+
ttgo-t-oi-plus.menu.CPUFreq.20.build.f_cpu=20000000L
2129+
ttgo-t-oi-plus.menu.CPUFreq.10=10MHz
2130+
ttgo-t-oi-plus.menu.CPUFreq.10.build.f_cpu=10000000L
2131+
2132+
ttgo-t-oi-plus.menu.FlashMode.qio=QIO
2133+
ttgo-t-oi-plus.menu.FlashMode.qio.build.flash_mode=dio
2134+
ttgo-t-oi-plus.menu.FlashMode.qio.build.boot=qio
2135+
ttgo-t-oi-plus.menu.FlashMode.dio=DIO
2136+
ttgo-t-oi-plus.menu.FlashMode.dio.build.flash_mode=dio
2137+
ttgo-t-oi-plus.menu.FlashMode.dio.build.boot=dio
2138+
ttgo-t-oi-plus.menu.FlashMode.qout=QOUT
2139+
ttgo-t-oi-plus.menu.FlashMode.qout.build.flash_mode=dout
2140+
ttgo-t-oi-plus.menu.FlashMode.qout.build.boot=qout
2141+
ttgo-t-oi-plus.menu.FlashMode.dout=DOUT
2142+
ttgo-t-oi-plus.menu.FlashMode.dout.build.flash_mode=dout
2143+
ttgo-t-oi-plus.menu.FlashMode.dout.build.boot=dout
2144+
2145+
ttgo-t-oi-plus.menu.FlashFreq.80=80MHz
2146+
ttgo-t-oi-plus.menu.FlashFreq.80.build.flash_freq=80m
2147+
ttgo-t-oi-plus.menu.FlashFreq.40=40MHz
2148+
ttgo-t-oi-plus.menu.FlashFreq.40.build.flash_freq=40m
2149+
2150+
ttgo-t-oi-plus.menu.FlashSize.4M=4MB (32Mb)
2151+
ttgo-t-oi-plus.menu.FlashSize.4M.build.flash_size=4MB
2152+
2153+
ttgo-t-oi-plus.menu.UploadSpeed.921600=921600
2154+
ttgo-t-oi-plus.menu.UploadSpeed.921600.upload.speed=921600
2155+
ttgo-t-oi-plus.menu.UploadSpeed.115200=115200
2156+
ttgo-t-oi-plus.menu.UploadSpeed.115200.upload.speed=115200
2157+
ttgo-t-oi-plus.menu.UploadSpeed.256000.windows=256000
2158+
ttgo-t-oi-plus.menu.UploadSpeed.256000.upload.speed=256000
2159+
ttgo-t-oi-plus.menu.UploadSpeed.230400.windows.upload.speed=256000
2160+
ttgo-t-oi-plus.menu.UploadSpeed.230400=230400
2161+
ttgo-t-oi-plus.menu.UploadSpeed.230400.upload.speed=230400
2162+
ttgo-t-oi-plus.menu.UploadSpeed.460800.linux=460800
2163+
ttgo-t-oi-plus.menu.UploadSpeed.460800.macosx=460800
2164+
ttgo-t-oi-plus.menu.UploadSpeed.460800.upload.speed=460800
2165+
ttgo-t-oi-plus.menu.UploadSpeed.512000.windows=512000
2166+
ttgo-t-oi-plus.menu.UploadSpeed.512000.upload.speed=512000
2167+
2168+
ttgo-t-oi-plus.menu.DebugLevel.none=None
2169+
ttgo-t-oi-plus.menu.DebugLevel.none.build.code_debug=0
2170+
ttgo-t-oi-plus.menu.DebugLevel.error=Error
2171+
ttgo-t-oi-plus.menu.DebugLevel.error.build.code_debug=1
2172+
ttgo-t-oi-plus.menu.DebugLevel.warn=Warn
2173+
ttgo-t-oi-plus.menu.DebugLevel.warn.build.code_debug=2
2174+
ttgo-t-oi-plus.menu.DebugLevel.info=Info
2175+
ttgo-t-oi-plus.menu.DebugLevel.info.build.code_debug=3
2176+
ttgo-t-oi-plus.menu.DebugLevel.debug=Debug
2177+
ttgo-t-oi-plus.menu.DebugLevel.debug.build.code_debug=4
2178+
ttgo-t-oi-plus.menu.DebugLevel.verbose=Verbose
2179+
ttgo-t-oi-plus.menu.DebugLevel.verbose.build.code_debug=5
2180+
2181+
##############################################################
2182+
20672183
cw02.name=XinaBox CW02
20682184

20692185
cw02.upload.tool=esptool_py
@@ -3794,6 +3910,13 @@ adafruit_metro_esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0
37943910
adafruit_metro_esp32s2.menu.DFUOnBoot.dfu=Enabled
37953911
adafruit_metro_esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
37963912

3913+
adafruit_metro_esp32s2.menu.UploadMode.cdc=Internal USB
3914+
adafruit_metro_esp32s2.menu.UploadMode.cdc.upload.use_1200bps_touch=true
3915+
adafruit_metro_esp32s2.menu.UploadMode.cdc.upload.wait_for_upload_port=true
3916+
adafruit_metro_esp32s2.menu.UploadMode.default=UART0
3917+
adafruit_metro_esp32s2.menu.UploadMode.default.upload.use_1200bps_touch=false
3918+
adafruit_metro_esp32s2.menu.UploadMode.default.upload.wait_for_upload_port=false
3919+
37973920
adafruit_metro_esp32s2.menu.PSRAM.enabled=Enabled
37983921
adafruit_metro_esp32s2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
37993922
adafruit_metro_esp32s2.menu.PSRAM.disabled=Disabled
@@ -3908,11 +4031,11 @@ adafruit_metro_esp32s2.menu.DebugLevel.verbose.build.code_debug=5
39084031

39094032
adafruit_magtag29_esp32s2.name=Adafruit MagTag 2.9"
39104033
adafruit_magtag29_esp32s2.vid.0=0x239A
3911-
adafruit_magtag29_esp32s2.pid.0=0x80DF
4034+
adafruit_magtag29_esp32s2.pid.0=0x80E5
39124035
adafruit_magtag29_esp32s2.vid.1=0x239A
3913-
adafruit_magtag29_esp32s2.pid.1=0x00DF
4036+
adafruit_magtag29_esp32s2.pid.1=0x00E5
39144037
adafruit_magtag29_esp32s2.vid.1=0x239A
3915-
adafruit_magtag29_esp32s2.pid.1=0x80E0
4038+
adafruit_magtag29_esp32s2.pid.1=0x80E6
39164039

39174040
adafruit_magtag29_esp32s2.upload.tool=esptool_py
39184041
adafruit_magtag29_esp32s2.upload.maximum_size=1310720
@@ -3959,6 +4082,13 @@ adafruit_magtag29_esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0
39594082
adafruit_magtag29_esp32s2.menu.DFUOnBoot.dfu=Enabled
39604083
adafruit_magtag29_esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
39614084

4085+
adafruit_magtag29_esp32s2.menu.UploadMode.cdc=Internal USB
4086+
adafruit_magtag29_esp32s2.menu.UploadMode.cdc.upload.use_1200bps_touch=true
4087+
adafruit_magtag29_esp32s2.menu.UploadMode.cdc.upload.wait_for_upload_port=true
4088+
adafruit_magtag29_esp32s2.menu.UploadMode.default=UART0
4089+
adafruit_magtag29_esp32s2.menu.UploadMode.default.upload.use_1200bps_touch=false
4090+
adafruit_magtag29_esp32s2.menu.UploadMode.default.upload.wait_for_upload_port=false
4091+
39624092
adafruit_magtag29_esp32s2.menu.PSRAM.enabled=Enabled
39634093
adafruit_magtag29_esp32s2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
39644094
adafruit_magtag29_esp32s2.menu.PSRAM.disabled=Disabled
@@ -4124,6 +4254,13 @@ adafruit_funhouse_esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0
41244254
adafruit_funhouse_esp32s2.menu.DFUOnBoot.dfu=Enabled
41254255
adafruit_funhouse_esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
41264256

4257+
adafruit_funhouse_esp32s2.menu.UploadMode.cdc=Internal USB
4258+
adafruit_funhouse_esp32s2.menu.UploadMode.cdc.upload.use_1200bps_touch=true
4259+
adafruit_funhouse_esp32s2.menu.UploadMode.cdc.upload.wait_for_upload_port=true
4260+
adafruit_funhouse_esp32s2.menu.UploadMode.default=UART0
4261+
adafruit_funhouse_esp32s2.menu.UploadMode.default.upload.use_1200bps_touch=false
4262+
adafruit_funhouse_esp32s2.menu.UploadMode.default.upload.wait_for_upload_port=false
4263+
41274264
adafruit_funhouse_esp32s2.menu.PSRAM.enabled=Enabled
41284265
adafruit_funhouse_esp32s2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
41294266
adafruit_funhouse_esp32s2.menu.PSRAM.disabled=Disabled
@@ -4236,7 +4373,7 @@ adafruit_funhouse_esp32s2.menu.DebugLevel.verbose.build.code_debug=5
42364373

42374374
##############################################################
42384375

4239-
adafruit_feather_esp32s2_nopsram.name=Adafruit Feather ESP32-S2 (no PSRAM)
4376+
adafruit_feather_esp32s2_nopsram.name=Adafruit Feather ESP32-S2
42404377
adafruit_feather_esp32s2_nopsram.vid.0=0x239A
42414378
adafruit_feather_esp32s2_nopsram.pid.0=0x80EB
42424379
adafruit_feather_esp32s2_nopsram.vid.1=0x239A
@@ -4261,7 +4398,7 @@ adafruit_feather_esp32s2_nopsram.build.target=esp32s2
42614398
adafruit_feather_esp32s2_nopsram.build.mcu=esp32s2
42624399
adafruit_feather_esp32s2_nopsram.build.core=esp32
42634400
adafruit_feather_esp32s2_nopsram.build.variant=adafruit_feather_esp32s2
4264-
adafruit_feather_esp32s2_nopsram.build.board=ADAFRUIT_FEATHER_ESP32S2_NOPSRAM
4401+
adafruit_feather_esp32s2_nopsram.build.board=ADAFRUIT_FEATHER_ESP32S2
42654402

42664403
adafruit_feather_esp32s2_nopsram.build.cdc_on_boot=0
42674404
adafruit_feather_esp32s2_nopsram.build.msc_on_boot=0
@@ -4289,10 +4426,10 @@ adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.default.build.dfu_on_boot=0
42894426
adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.dfu=Enabled
42904427
adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
42914428

4292-
adafruit_feather_esp32s2_nopsram.menu.PSRAM.disabled=Disabled
4293-
adafruit_feather_esp32s2_nopsram.menu.PSRAM.disabled.build.defines=
42944429
adafruit_feather_esp32s2_nopsram.menu.PSRAM.enabled=Enabled
42954430
adafruit_feather_esp32s2_nopsram.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
4431+
adafruit_feather_esp32s2_nopsram.menu.PSRAM.disabled=Disabled
4432+
adafruit_feather_esp32s2_nopsram.menu.PSRAM.disabled.build.defines=
42964433

42974434
adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
42984435
adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default.build.partitions=default
@@ -9379,19 +9516,32 @@ atmegazero_esp32s2.build.core=esp32
93799516
atmegazero_esp32s2.build.variant=atmegazero_esp32s2
93809517
atmegazero_esp32s2.build.board=atmegazero_esp32s2
93819518

9519+
atmegazero_esp32s2.build.cdc_on_boot=1
9520+
atmegazero_esp32s2.build.msc_on_boot=0
9521+
atmegazero_esp32s2.build.dfu_on_boot=0
93829522
atmegazero_esp32s2.build.serial=0
93839523
atmegazero_esp32s2.build.f_cpu=240000000L
9384-
atmegazero_esp32s2.build.flash_size=4MB
9385-
atmegazero_esp32s2.build.flash_freq=80m
9524+
atmegazero_esp32s2.build.flash_size=16MB
9525+
atmegazero_esp32s2.build.flash_freq=40m
93869526
atmegazero_esp32s2.build.flash_mode=qio
93879527
atmegazero_esp32s2.build.boot=qio
93889528
atmegazero_esp32s2.build.partitions=default
93899529
atmegazero_esp32s2.build.defines=
93909530

9391-
atmegazero_esp32s2.menu.SerialMode.cdc=USB CDC
9392-
atmegazero_esp32s2.menu.SerialMode.cdc.build.serial=1
9393-
atmegazero_esp32s2.menu.SerialMode.default=UART0
9394-
atmegazero_esp32s2.menu.SerialMode.default.build.serial=0
9531+
atmegazero_esp32s2.menu.CDCOnBoot.cdc=Enabled
9532+
atmegazero_esp32s2.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
9533+
atmegazero_esp32s2.menu.CDCOnBoot.default=Disabled
9534+
atmegazero_esp32s2.menu.CDCOnBoot.default.build.cdc_on_boot=0
9535+
9536+
atmegazero_esp32s2.menu.MSCOnBoot.default=Disabled
9537+
atmegazero_esp32s2.menu.MSCOnBoot.default.build.msc_on_boot=0
9538+
atmegazero_esp32s2.menu.MSCOnBoot.msc=Enabled
9539+
atmegazero_esp32s2.menu.MSCOnBoot.msc.build.msc_on_boot=1
9540+
9541+
atmegazero_esp32s2.menu.DFUOnBoot.default=Disabled
9542+
atmegazero_esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0
9543+
atmegazero_esp32s2.menu.DFUOnBoot.dfu=Enabled
9544+
atmegazero_esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
93959545

93969546
atmegazero_esp32s2.menu.PSRAM.disabled=Disabled
93979547
atmegazero_esp32s2.menu.PSRAM.disabled.build.defines=
@@ -9537,10 +9687,10 @@ deneyapmini.build.boot=qio
95379687
deneyapmini.build.partitions=default
95389688
deneyapmini.build.defines=
95399689

9540-
deneyapmini.menu.SerialMode.default=USB_CDC
9541-
deneyapmini.menu.SerialMode.default.build.serial=1
9542-
deneyapmini.menu.SerialMode.uart=UART0
9543-
deneyapmini.menu.SerialMode.uart.build.serial=0
9690+
deneyapmini.menu.CDCOnBoot.default=Disabled
9691+
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=0
9692+
deneyapmini.menu.CDCOnBoot.cdc=Enabled
9693+
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
95449694

95459695
deneyapmini.menu.PSRAM.disabled=Disabled
95469696
deneyapmini.menu.PSRAM.disabled.build.defines=

cores/esp32/Esp.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extern "C" {
3838
#define ESP_FLASH_IMAGE_BASE 0x1000 // Flash offset containing flash size and spi mode
3939
#elif CONFIG_IDF_TARGET_ESP32S2
4040
#include "esp32s2/rom/spi_flash.h"
41+
#include "soc/efuse_reg.h"
4142
#define ESP_FLASH_IMAGE_BASE 0x1000
4243
#elif CONFIG_IDF_TARGET_ESP32C3
4344
#include "esp32c3/rom/spi_flash.h"
@@ -270,7 +271,17 @@ const char * EspClass::getChipModel(void)
270271
return "Unknown";
271272
}
272273
#elif CONFIG_IDF_TARGET_ESP32S2
273-
return "ESP32-S2";
274+
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION);
275+
switch (pkg_ver) {
276+
case 0:
277+
return "ESP32-S2";
278+
case 1:
279+
return "ESP32-S2FH16";
280+
case 2:
281+
return "ESP32-S2FH32";
282+
default:
283+
return "ESP32-S2 (Unknown)";
284+
}
274285
#elif CONFIG_IDF_TARGET_ESP32S3
275286
return "ESP32-S3";
276287
#elif CONFIG_IDF_TARGET_ESP32C3

cores/esp32/FirmwareMSC.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ static size_t msc_update_get_required_disk_sectors(){
113113
log_d("USING FAT12");
114114
mcs_is_fat16 = false;
115115
}
116+
log_d("FAT sector size: %u", DISK_SECTOR_SIZE);
116117
log_d("FAT data sectors: %u", data_sectors);
117118
log_d("FAT table sectors: %u", msc_table_sectors);
118119
log_d("FAT total sectors: %u (%uKB)", total_sectors, (total_sectors * DISK_SECTOR_SIZE) / 1024);
@@ -227,7 +228,7 @@ static esp_err_t msc_update_write(const esp_partition_t *partition, uint32_t off
227228
//called when error was encountered while updating
228229
static void msc_update_error(){
229230
log_e("UPDATE_ERROR: %u", msc_update_bytes_written);
230-
arduino_firmware_msc_event_data_t p = {0};
231+
arduino_firmware_msc_event_data_t p;
231232
p.error.size = msc_update_bytes_written;
232233
arduino_usb_event_post(ARDUINO_FIRMWARE_MSC_EVENTS, ARDUINO_FIRMWARE_MSC_ERROR_EVENT, &p, sizeof(arduino_firmware_msc_event_data_t), portMAX_DELAY);
233234
msc_update_state = MSC_UPDATE_IDLE;
@@ -251,7 +252,7 @@ static void msc_update_end(){
251252
msc_update_error();
252253
return;
253254
}
254-
arduino_firmware_msc_event_data_t p = {0};
255+
arduino_firmware_msc_event_data_t p;
255256
p.end.size = msc_update_entry->file_size;
256257
arduino_usb_event_post(ARDUINO_FIRMWARE_MSC_EVENTS, ARDUINO_FIRMWARE_MSC_END_EVENT, &p, sizeof(arduino_firmware_msc_event_data_t), portMAX_DELAY);
257258
}
@@ -289,7 +290,7 @@ static int32_t msc_write(uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_
289290
}
290291
} else if(msc_ota_partition && lba >= msc_update_start_sector){
291292
//handle writes to the region where the new firmware will be uploaded
292-
arduino_firmware_msc_event_data_t p = {0};
293+
arduino_firmware_msc_event_data_t p;
293294
if(msc_update_state <= MSC_UPDATE_STARTING && buffer[0] == 0xE9){
294295
msc_update_state = MSC_UPDATE_RUNNING;
295296
msc_update_start_sector = lba;
@@ -345,7 +346,7 @@ static int32_t msc_read(uint32_t lba, uint32_t offset, void* buffer, uint32_t bu
345346

346347
static bool msc_start_stop(uint8_t power_condition, bool start, bool load_eject){
347348
//log_d("power: %u, start: %u, eject: %u", power_condition, start, load_eject);
348-
arduino_firmware_msc_event_data_t p = {0};
349+
arduino_firmware_msc_event_data_t p;
349350
p.power.power_condition = power_condition;
350351
p.power.start = start;
351352
p.power.load_eject = load_eject;

cores/esp32/HWCDC.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void HWCDC::begin(unsigned long baud)
169169

170170
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET);
171171
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET);
172-
if(!intr_handle && esp_intr_alloc(ETS_USB_INTR_SOURCE/*ETS_USB_SERIAL_JTAG_INTR_SOURCE*/, 0, hw_cdc_isr_handler, NULL, &intr_handle) != ESP_OK){
172+
if(!intr_handle && esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, 0, hw_cdc_isr_handler, NULL, &intr_handle) != ESP_OK){
173173
isr_log_e("HW USB CDC failed to init interrupts");
174174
end();
175175
return;

cores/esp32/HardwareSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ HardwareSerial Serial1(1);
8787
#if SOC_UART_NUM > 2
8888
HardwareSerial Serial2(2);
8989
#endif
90-
#endif
9190

9291
void serialEventRun(void)
9392
{
@@ -105,6 +104,7 @@ void serialEventRun(void)
105104
if(Serial2.available()) serialEvent2();
106105
#endif
107106
}
107+
#endif
108108

109109

110110
HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL), _rxBufferSize(256) {}

0 commit comments

Comments
 (0)