diff --git a/boards/esp32_4M_2APP.json b/boards/esp32_4M_2APP.json index 34e8248e6..e2117ef59 100644 --- a/boards/esp32_4M_2APP.json +++ b/boards/esp32_4M_2APP.json @@ -30,8 +30,12 @@ "arduino": { "flash_extra_images": [ [ - "0x2E0000", + "0x10000", "variants/tasmota/tasmota32-minicustom.bin" + ], + [ + "0x3B0000", + "variants/tasmota/littlefs.bin" ] ] }, diff --git a/boards/esp32c3_2APP.json b/boards/esp32c3_2APP.json new file mode 100644 index 000000000..a523062e6 --- /dev/null +++ b/boards/esp32c3_2APP.json @@ -0,0 +1,47 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32c3_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DESP32C3", + "f_cpu": "160000000L", + "f_flash": "80000000L", + "flash_mode": "dout", + "mcu": "esp32c3", + "variant": "esp32c3", + "partitions": "esp32_partition_app2880k_spiffs320k.csv" + }, + "connectivity": [ + "wifi" + ], + "debug": { + "openocd_target": "esp32c3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif Generic ESP32-C3 4M Flash, Tasmota 1856k Code/OTA, 320k FS", + "upload": { + "arduino": { + "flash_extra_images": [ + [ + "0x10000", + "variants/tasmota/tasmota32c3-minicustom.bin" + ], + [ + "0x3B0000", + "variants/tasmota/littlefs.bin" + ] + ] + }, + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html", + "vendor": "Espressif" + } diff --git a/esp32_partition_app2880k_spiffs320k.csv b/esp32_partition_app2880k_spiffs320k.csv index 511ce01a1..1e319a6b9 100644 --- a/esp32_partition_app2880k_spiffs320k.csv +++ b/esp32_partition_app2880k_spiffs320k.csv @@ -1,6 +1,6 @@ # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x2D0000, -factory, app, factory, 0x2E0000,0xD0000, +factory, app, factory, 0x10000,0xD0000, +app0, app, ota_0, 0xE0000, 0x2D0000, spiffs, data, spiffs, 0x3B0000,0x50000, diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index 662d011d8..055582d33 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -22,6 +22,7 @@ platform = env.PioPlatform() import sys from os.path import join +import csv sys.path.append(join(platform.get_package_dir("tool-esptoolpy"))) import esptool @@ -31,7 +32,21 @@ def esp32_create_combined_bin(source, target, env): # The offset from begin of the file where the app0 partition starts # This is defined in the partition .csv file - app_offset = 0x10000 + app_offset = 0x10000 # default value + with open(env.BoardConfig().get("build.partitions")) as csv_file: + print("Read partitions from ",env.BoardConfig().get("build.partitions")) + csv_reader = csv.reader(csv_file, delimiter=',') + line_count = 0 + for row in csv_reader: + if line_count == 0: + print(f'{", ".join(row)}') + line_count += 1 + else: + print(f'{row[0]} {row[1]} {row[2]} {row[3]} {row[4]}') + line_count += 1 + if(row[0] == 'app0'): + app_offset = int(row[3],base=16) +# print("Got app_offset from .csv:", row[3]) new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin") sections = env.subst(env.get("FLASH_EXTRA_IMAGES")) diff --git a/safemode/littlefs.bin b/safemode/littlefs.bin new file mode 100644 index 000000000..796a29308 Binary files /dev/null and b/safemode/littlefs.bin differ diff --git a/safemode/tasmota32c3-minicustom.bin b/safemode/tasmota32c3-minicustom.bin new file mode 100644 index 000000000..fc5631e42 Binary files /dev/null and b/safemode/tasmota32c3-minicustom.bin differ