Merge pull request #15493 from Jason2866/development

remove fixed address 0x10000 for firmware
This commit is contained in:
Jason2866 2022-04-30 14:25:15 +02:00 committed by GitHub
commit a0ad780893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 4 deletions

View File

@ -30,8 +30,12 @@
"arduino": { "arduino": {
"flash_extra_images": [ "flash_extra_images": [
[ [
"0x2E0000", "0x10000",
"variants/tasmota/tasmota32-minicustom.bin" "variants/tasmota/tasmota32-minicustom.bin"
],
[
"0x3B0000",
"variants/tasmota/littlefs.bin"
] ]
] ]
}, },

47
boards/esp32c3_2APP.json Normal file
View File

@ -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"
}

View File

@ -1,6 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags # Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000, nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000, otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x2D0000, factory, app, factory, 0x10000,0xD0000,
factory, app, factory, 0x2E0000,0xD0000, app0, app, ota_0, 0xE0000, 0x2D0000,
spiffs, data, spiffs, 0x3B0000,0x50000, spiffs, data, spiffs, 0x3B0000,0x50000,

1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 factory app ota_0 factory 0x10000 0x2D0000 0xD0000
5 factory app0 app factory ota_0 0x2E0000 0xE0000 0xD0000 0x2D0000
6 spiffs data spiffs 0x3B0000 0x50000

View File

@ -22,6 +22,7 @@ platform = env.PioPlatform()
import sys import sys
from os.path import join from os.path import join
import csv
sys.path.append(join(platform.get_package_dir("tool-esptoolpy"))) sys.path.append(join(platform.get_package_dir("tool-esptoolpy")))
import esptool 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 # The offset from begin of the file where the app0 partition starts
# This is defined in the partition .csv file # 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") new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin")
sections = env.subst(env.get("FLASH_EXTRA_IMAGES")) sections = env.subst(env.get("FLASH_EXTRA_IMAGES"))

BIN
safemode/littlefs.bin Normal file

Binary file not shown.

Binary file not shown.