mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
change from string to list
and hack for using littlefs for ESP32 instead of SPIFFS
This commit is contained in:
parent
6a2016f568
commit
7fc0c42e04
@ -23,6 +23,10 @@ Import("env")
|
|||||||
platform = env.PioPlatform()
|
platform = env.PioPlatform()
|
||||||
board = env.BoardConfig()
|
board = env.BoardConfig()
|
||||||
mcu = board.get("build.mcu", "esp32")
|
mcu = board.get("build.mcu", "esp32")
|
||||||
|
# Hack for using mklittlefs instead of mkspiffs -> needed since littlefs is not supported with this for ESP32
|
||||||
|
#print("Replace MKSPIFFSTOOL with mklittlefs")
|
||||||
|
env.Replace( MKSPIFFSTOOL=platform.get_package_dir("tool-mklittlefs") + '/mklittlefs' )
|
||||||
|
|
||||||
# needed for later
|
# needed for later
|
||||||
AutodetectUploadPort(env)
|
AutodetectUploadPort(env)
|
||||||
|
|
||||||
@ -41,7 +45,7 @@ class FSInfo:
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"FS type {self.fs_type} Start {hex(self.start)} Len {self.length} Page size {self.page_size} Block size {self.block_size}"
|
return f"FS type {self.fs_type} Start {hex(self.start)} Len {self.length} Page size {self.page_size} Block size {self.block_size}"
|
||||||
# extract command supposed to be implemented by subclasses
|
# extract command supposed to be implemented by subclasses
|
||||||
def get_extract_cmd(self):
|
def get_extract_cmd(self, input_file, output_dir):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
class LittleFSInfo(FSInfo):
|
class LittleFSInfo(FSInfo):
|
||||||
@ -56,7 +60,7 @@ class LittleFSInfo(FSInfo):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"FS type {self.fs_type} Start {hex(self.start)} Len {self.length} Page size {self.page_size} Block size {self.block_size} Tool: {self.tool}"
|
return f"FS type {self.fs_type} Start {hex(self.start)} Len {self.length} Page size {self.page_size} Block size {self.block_size} Tool: {self.tool}"
|
||||||
def get_extract_cmd(self, input_file, output_dir):
|
def get_extract_cmd(self, input_file, output_dir):
|
||||||
return f'"{self.tool}" -b {self.block_size} -p {self.page_size} --unpack "{output_dir}" "{input_file}"'
|
return [self.tool, "-b", str(self.block_size), "-p", str(self.page_size), "--unpack", output_dir, input_file]
|
||||||
|
|
||||||
|
|
||||||
class SPIFFSInfo(FSInfo):
|
class SPIFFSInfo(FSInfo):
|
||||||
@ -258,16 +262,16 @@ def download_fs(fs_info: FSInfo):
|
|||||||
fs_file = join(env["PROJECT_DIR"], f"downloaded_fs_{hex(fs_info.start)}_{hex(fs_info.length)}.bin")
|
fs_file = join(env["PROJECT_DIR"], f"downloaded_fs_{hex(fs_info.start)}_{hex(fs_info.length)}.bin")
|
||||||
esptoolpy_flags = [
|
esptoolpy_flags = [
|
||||||
"--chip", mcu,
|
"--chip", mcu,
|
||||||
"--port", '"' + env.subst("$UPLOAD_PORT") + '"',
|
"--port", env.subst("$UPLOAD_PORT"),
|
||||||
"--baud", env.subst("$UPLOAD_SPEED"),
|
"--baud", env.subst("$UPLOAD_SPEED"),
|
||||||
"--before", "default_reset",
|
"--before", "default_reset",
|
||||||
"--after", "hard_reset",
|
"--after", "hard_reset",
|
||||||
"read_flash",
|
"read_flash",
|
||||||
hex(fs_info.start),
|
hex(fs_info.start),
|
||||||
hex(fs_info.length),
|
hex(fs_info.length),
|
||||||
'"' + fs_file + '"'
|
fs_file
|
||||||
]
|
]
|
||||||
esptoolpy_cmd = '"' + env["PYTHONEXE"]+ '"' + ' "' + esptoolpy + '" ' + " ".join(esptoolpy_flags)
|
esptoolpy_cmd = [env["PYTHONEXE"], esptoolpy] + esptoolpy_flags
|
||||||
print("Executing flash download command.")
|
print("Executing flash download command.")
|
||||||
print(esptoolpy_cmd)
|
print(esptoolpy_cmd)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user