Phase 1 support C2/C6

This commit is contained in:
Theo Arends 2023-08-21 17:32:54 +02:00
parent dd877972be
commit dc68232f42
10 changed files with 425 additions and 43 deletions

44
boards/esp32c2.json Normal file
View File

@ -0,0 +1,44 @@
{
"build": {
"arduino":{
"ldscript": "esp32c2_out.ld"
},
"core": "esp32",
"extra_flags": "-DESP32_4M -DESP32C2",
"f_cpu": "120000000L",
"f_flash": "60000000L",
"flash_mode": "dio",
"mcu": "esp32c2",
"variant": "esp32c2",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32c2.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif Generic ESP32-C2 = 4M Flash",
"upload": {
"arduino": {
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c2-safeboot.bin"
]
]
},
"flash_size": "4MB",
"maximum_ram_size": 278528,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}

44
boards/esp32c2_2M.json Normal file
View File

@ -0,0 +1,44 @@
{
"build": {
"arduino":{
"ldscript": "esp32c2_out.ld"
},
"core": "esp32",
"extra_flags": "-DESP32_2M -DESP32C2",
"f_cpu": "120000000L",
"f_flash": "60000000L",
"flash_mode": "dio",
"mcu": "esp32c2",
"variant": "esp32c2",
"partitions": "partitions/esp32_partition_app1245k_fs64k.csv"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32c2.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif Generic ESP32-C2 = 2M Flash, Tasmota 1245kB Code/OTA, 64k FS",
"upload": {
"arduino": {
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c2-safeboot.bin"
]
]
},
"flash_size": "2MB",
"maximum_ram_size": 278528,
"maximum_size": 2097152,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}

View File

@ -7,7 +7,7 @@
"extra_flags": "-DESP32_4M -DESP32C6",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"flash_mode": "qio",
"mcu": "esp32c6",
"variant": "esp32c6",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

45
boards/esp32c6cdc.json Normal file
View File

@ -0,0 +1,45 @@
{
"build": {
"arduino":{
"ldscript": "esp32c6_out.ld"
},
"core": "esp32",
"extra_flags": "-DARDUINO_USB_MODE=1 -DESP32_4M -DESP32C6 -DUSE_USB_CDC_CONSOLE",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32c6",
"variant": "esp32c6",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32c6.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": {
"arduino": {
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c6cdc-safeboot.bin"
]
]
},
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"before_reset": "usb_reset",
"speed": 460800
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}

View File

@ -68,10 +68,28 @@
#define SPI_HOST SPI1_HOST
#define HSPI_HOST SPI2_HOST
#define VSPI_HOST SPI2_HOST /* No SPI3_host on C3 */
#if ESP_IDF_VERSION_MAJOR < 5
// fix a bug in esp-idf 4.4 for esp32c3
#ifndef REG_SPI_BASE
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
// SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
#endif // REG_SPI_BASE
#endif //ESP_IDF_VERSION_MAJOR < 5
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6
#define SPI_HOST SPI1_HOST
#define HSPI_HOST SPI1_HOST /* No SPI2_host on C2/C6 */
#define VSPI_HOST SPI1_HOST /* No SPI3_host on C2/C6 */
#define VSPI SPI
// #if ESP_IDF_VERSION_MAJOR < 5
// // fix a bug in esp-idf 4.4 for esp32c3
// #ifndef REG_SPI_BASE
// #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
// // SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
// #endif // REG_SPI_BASE
// #endif //ESP_IDF_VERSION_MAJOR < 5
#endif // TARGET

View File

@ -0,0 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
safeboot, app, factory, 0x10000, 0xB0000,
app0, app, ota_0, 0xC0000, 0x130000,
spiffs, data, spiffs, 0x1f0000,0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 safeboot app factory 0x10000 0xB0000
5 app0 app ota_0 0xC0000 0x130000
6 spiffs data spiffs 0x1f0000 0x10000

View File

@ -25,3 +25,9 @@ if os.path.isfile("platformio_tasmota_cenv.ini"):
print ("*** use provided platformio_tasmota_cenv.ini as planned ***")
else:
shutil.copy("platformio_tasmota_cenv_sample.ini", "platformio_tasmota_cenv.ini")
# copy platformio_tasmota_core3_env_sample.ini to platformio_tasmota_core3_env.ini
if os.path.isfile("platformio_tasmota_core3_env.ini"):
print ("*** use provided platformio_tasmota_core3_env.ini as planned ***")
else:
shutil.copy("platformio_tasmota_core3_env_sample.ini", "platformio_tasmota_core3_env.ini")

View File

@ -24,6 +24,7 @@ extra_configs = platformio_tasmota32.ini
platformio_tasmota_env32.ini
platformio_override.ini
platformio_tasmota_cenv.ini
platformio_tasmota_core3_env.ini
[common]
platform = ${core.platform}

View File

@ -0,0 +1,259 @@
[platformio]
; *** Build/upload environments for ESP32 Arduino Core 3.0
; *** Uncomment the line below and one or more env to select version(s)
;default_envs =
; tasmota32-arduino30
; tasmota32-odroid30
; tasmota32s2-arduino30
; tasmota32s3-arduino30
; tasmota32c2-arduino30
; tasmota32c3-arduino30
; tasmota32c3cdc-arduino30
; tasmota32c6-arduino30
; tasmota32c6cdc-arduino30
; tasmota32-safeboot
; tasmota32s2-safeboot
; tasmota32s3-safeboot
; tasmota32c2-safeboot
; tasmota32c3-safeboot
; tasmota32c3cdc-safeboot
; tasmota32c6-safeboot
; tasmota32c6cdc-safeboot
[core32_30]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1511/framework-arduinoespressif32-release_v5.1-90b05eff62.zip
build_unflags = ${core32.build_unflags}
build_flags = ${core32.build_flags}
[core32_30_flags]
build_unflags = ${core32_30.build_unflags}
-DUSE_IPV6
build_flags = ${core32_30.build_flags}
lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_display, lib/lib_rf, lib/libesp32, lib/libesp32_div, lib/libesp32_lvgl
lib_ignore =
HTTPUpdateServer
USB
SPIFFS
ESP32 Async UDP
NetBIOS
Preferences
BluetoothSerial
ArduinoOTA
ESP Mail Client
IRremoteESP8266
ESP8266Audio
ESP8266SAM
ESP32-HomeKit
NimBLE-Arduino
[env:arduino30]
framework = ${common.framework}
platform = ${core32_30.platform}
platform_packages = ${core32_30.platform_packages}
board_build.filesystem = ${common.board_build.filesystem}
custom_unpack_dir = ${common.custom_unpack_dir}
board = esp32
monitor_speed = 115200
upload_resetmethod = ${common.upload_resetmethod}
extra_scripts = ${esp32_defaults.extra_scripts}
build_unflags = ${core32_30_flags.build_unflags}
build_flags = ${core32_30_flags.build_flags}
lib_ldf_mode = ${common.lib_ldf_mode}
lib_compat_mode = ${common.lib_compat_mode}
lib_extra_dirs = ${core32_30_flags.lib_extra_dirs}
lib_ignore = ${core32_30_flags.lib_ignore}
[env:tasmota32-arduino30]
extends = env:arduino30
board = esp32
build_unflags = ${env:arduino30.build_unflags}
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
-DUSE_MI_HOMEKIT=0 ; 1 to enable; 0 to disable
-DUSE_MI_ESP32
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32-odroid30]
extends = env:arduino30
board = esp32-fix
board_build.f_cpu = 240000000L
upload_port = /dev/cu.SLAB_USBtoUART
build_unflags = ${env:arduino30.build_unflags}
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32s2-arduino30]
extends = env:arduino30
board = esp32s2
build_unflags = ${env:arduino30.build_unflags}
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32s3-arduino30]
extends = env:arduino30
board = esp32s3-qio_qspi
build_unflags = ${env:arduino30.build_unflags}
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
-DUSE_MI_HOMEKIT=0 ; 1 to enable; 0 to disable
-DUSE_MI_ESP32
monitor_filters = esp32_exception_decoder
lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_rf, lib/libesp32, lib/libesp32_div
lib_ignore = ${env:arduino30.lib_ignore}
universal display Library
[env:tasmota32c2-arduino30]
extends = env:arduino30
board = esp32c2
build_unflags = ${env:arduino30.build_unflags}
-flto
-mtarget-align
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
-DNO_NEOPIXEL
-DUSE_MI_HOMEKIT=0 ; 1 to enable; 0 to disable
-DUSE_MI_ESP32
-fno-lto
-DOTA_URL='""'
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
NeoPixelBus
[env:tasmota32c3-arduino30]
extends = env:arduino30
board = esp32c3
build_unflags = ${env:arduino30.build_unflags}
-flto
-mtarget-align
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
-DUSE_MI_HOMEKIT=0 ; 1 to enable; 0 to disable
-DUSE_MI_ESP32
-fno-lto
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32c3cdc-arduino30]
extends = env:arduino30
board = esp32c3cdc
build_unflags = ${env:arduino30.build_unflags}
-flto
-mtarget-align
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
-fno-lto
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32c6-arduino30]
extends = env:arduino30
board = esp32c6
build_unflags = ${env:arduino30.build_unflags}
-flto
-mtarget-align
build_flags = ${env:arduino30.build_flags}
-fno-lto
-DFIRMWARE_ARDUINO30
-DUSE_MI_HOMEKIT=0 ; 1 to enable; 0 to disable
-DUSE_MI_ESP32
-DOTA_URL='""'
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32c6cdc-arduino30]
extends = env:arduino30
board = esp32c6cdc
build_unflags = ${env:arduino30.build_unflags}
-flto
-mtarget-align
build_flags = ${env:arduino30.build_flags}
-fno-lto
-DFIRMWARE_ARDUINO30
-DUSE_MI_HOMEKIT=0 ; 1 to enable; 0 to disable
-DUSE_MI_ESP32
-DOTA_URL='""'
monitor_filters = esp32_exception_decoder
lib_ignore = ${env:arduino30.lib_ignore}
[env:tasmota32-safeboot]
extends = env:tasmota32-arduino30
build_unflags = ${env:tasmota32-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32s2-safeboot]
extends = env:tasmota32s2-arduino30
build_unflags = ${env:tasmota32s2-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32s2-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32s3-safeboot]
extends = env:tasmota32s3-arduino30
build_unflags = ${env:tasmota32s3-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32s3-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32c2-safeboot]
extends = env:tasmota32c2-arduino30
build_unflags = ${env:tasmota32c2-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32c2-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32c3-safeboot]
extends = env:tasmota32c3-arduino30
build_unflags = ${env:tasmota32c3-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32c3-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32c3cdc-safeboot]
extends = env:tasmota32c3-arduino30
board = esp32c3cdc
build_unflags = ${env:tasmota32c3-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32c3-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32c6-safeboot]
extends = env:tasmota32c6-arduino30
build_unflags = ${env:tasmota32c6-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32c6-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}
[env:tasmota32c6cdc-safeboot]
extends = env:tasmota32c6-arduino30
board = esp32c6cdc
build_unflags = ${env:tasmota32c6-arduino30.build_unflags}
-DFIRMWARE_ARDUINO30
build_flags = ${env:tasmota32c6-arduino30.build_flags}
-DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore = ${safeboot_flags.lib_ignore}

View File

@ -15,7 +15,6 @@ lib_compat_mode = ${common.lib_compat_mode}
lib_extra_dirs = ${common.lib_extra_dirs}
lib/libesp32
lib/libesp32_lvgl
lib/libesp32_eink
lib/libesp32_audio
lib_ignore =
HTTPUpdateServer
@ -26,7 +25,7 @@ lib_ignore =
ESP32 Azure IoT Arduino
ESP32 Async UDP
ESP32 BLE Arduino
; SimpleBLE
SimpleBLE
NetBIOS
ESP32
Preferences
@ -39,46 +38,6 @@ lib_ignore =
; tasmota/berry/modules/Partition_Manager.tapp
custom_files_upload = no_files
[env:tasmota32-arduino30]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1457/framework-arduinoespressif32-release_v5.1-69cdc81680.zip
extends = env:tasmota32_base
board = esp32
build_unflags = ${env:tasmota32_base.build_unflags}
-DUSE_IPV6
build_flags = ${env:tasmota32_base.build_flags}
-DFIRMWARE_ARDUINO30
-DOTA_URL='""'
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore =
ESP Mail Client
IRremoteESP8266
NeoPixelBus
MFRC522
universal display Library
ESP8266Audio
ESP8266SAM
[env:tasmota32c6-safeboot]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1457/framework-arduinoespressif32-release_v5.1-69cdc81680.zip
extends = env:tasmota32_base
board = esp32c6
build_unflags = ${env:tasmota32_base.build_unflags}
-DUSE_IPV6
build_flags = ${env:tasmota32_base.build_flags}
-DFIRMWARE_SAFEBOOT
-DOTA_URL='""'
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore =
ESP Mail Client
IRremoteESP8266
NeoPixelBus
MFRC522
universal display Library
ESP8266Audio
ESP8266SAM
[env:tasmota32-safeboot]
extends = env:tasmota32_base
build_flags = ${env:tasmota32_base.build_flags}