ci(ci-fix): fix build bug related to esp32s3

This commit is contained in:
ZanzyTHEbar 2023-10-27 14:27:50 +01:00
parent 84a71f9802
commit a4ccca6e2a
4 changed files with 45 additions and 6 deletions

View File

@ -11,7 +11,10 @@
],
"settings": {
"cSpell.words": [
"bootloader",
"branchcmd",
"cctype",
"checkgit",
"cinttypes",
"clocale",
"cmath",
@ -25,17 +28,25 @@
"cwctype",
"deque",
"ESPS",
"esptool",
"esptoolpy",
"fstream",
"iomanip",
"iosfwd",
"iostream",
"istream",
"JTAG",
"mfile",
"ostream",
"PIOENV",
"projcmd",
"PYTHONEXE",
"revcmd",
"sccb",
"sstream",
"stdexcept",
"streambuf",
"tagcmd",
"txpower",
"typeinfo",
"XIAO"

2
ESP/.gitignore vendored
View File

@ -3,5 +3,7 @@
build/
*.log
/tools/firmware_name.txt
/tools/env_dump.txt
/tools/env_dump.json
/tools/version.txt
/tools/__pycache__/

View File

@ -53,13 +53,31 @@ def createZip(source, target, env):
# join the offset and path into a space separated string
temp.append("{} {}".format(offset, path))
# detect if the PIOENV has QIO flash mode
flash_mode = env["BOARD_FLASH_MODE"]
flash_freq = env["BOARD_F_FLASH"]
# detect the chip type
chip_type = env["BOARD_MCU"]
# capitalize the chip type
chip_type = chip_type.upper()
print("Flash Mode: %s" % flash_mode)
print("Chip Type: %s" % chip_type)
"""
python esptool.py --chip ESP32 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 40m --flash_size 4MB
0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot.bin 0x10000 OpenIris-v1.3.0-esp32AIThinker-8229a3a-master.bin
"""
execute_cmd = "$PYTHONEXE $PROJECT_PACKAGES_DIR/tool-esptoolpy/esptool.py --chip {chip} merge_bin -o merged-firmware.bin --flash_mode {flash_mode} --flash_freq {flash_freq} --flash_size 4MB %s" % (
" ".join(temp)
)
print("Executing: %s" % execute_cmd)
env.Execute(
"$PYTHONEXE $PROJECT_PACKAGES_DIR/tool-esptoolpy/esptool.py --chip ESP32 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 40m --flash_size 4MB %s"
% (" ".join(temp))
execute_cmd.format(
chip=chip_type, flash_mode=flash_mode, flash_freq=flash_freq)
)
filename = basename("merged-firmware.bin")
@ -77,7 +95,7 @@ def createZip(source, target, env):
"new_install_prompt_erase": new_install_prompt_erase,
"builds": [
{
"chipFamily": "ESP32",
"chipFamily": chip_type,
"parts": parts,
}
],

View File

@ -152,10 +152,18 @@ try:
flags = env["BUILD_FLAGS"]
my_flags = env.ParseFlags(flags)
# detect if the PIOENV has QIO flash mode
flash_mode = env["BOARD_FLASH_MODE"]
# detect the chip type
chip_type = env["BOARD_MCU"]
print("Flash Mode: %s" % flash_mode)
print("Chip Type: %s" % chip_type)
# Dump global construction environment (for debug purpose)
# write env.Dump() to a file
# with open("env_dump.txt", "w") as f:
# f.write(env.Dump())
with open("./tools/env_dump.txt", "w") as f:
f.write(env.Dump())
handleGit()
except ValueError as ex:
@ -165,6 +173,6 @@ except ValueError as ex:
"[Warning]: Apostrophes are not allowed in the build flags. Please remove them from the \033[;1m\033[1;36m`user-config.ini` \033[1;31mfile and try again."
)
raise Exception(
"Could not parse BUILD_FLAGS - Possible apostrophy used in user configuration",
"Could not parse BUILD_FLAGS - Possible apostrophe used in user configuration",
ex,
)