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

2
ESP/.gitignore vendored
View File

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

View File

@ -53,13 +53,31 @@ def createZip(source, target, env):
# join the offset and path into a space separated string # join the offset and path into a space separated string
temp.append("{} {}".format(offset, path)) 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 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 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( 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" execute_cmd.format(
% (" ".join(temp)) chip=chip_type, flash_mode=flash_mode, flash_freq=flash_freq)
) )
filename = basename("merged-firmware.bin") filename = basename("merged-firmware.bin")
@ -77,7 +95,7 @@ def createZip(source, target, env):
"new_install_prompt_erase": new_install_prompt_erase, "new_install_prompt_erase": new_install_prompt_erase,
"builds": [ "builds": [
{ {
"chipFamily": "ESP32", "chipFamily": chip_type,
"parts": parts, "parts": parts,
} }
], ],

View File

@ -152,10 +152,18 @@ try:
flags = env["BUILD_FLAGS"] flags = env["BUILD_FLAGS"]
my_flags = env.ParseFlags(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) # Dump global construction environment (for debug purpose)
# write env.Dump() to a file # write env.Dump() to a file
# with open("env_dump.txt", "w") as f: with open("./tools/env_dump.txt", "w") as f:
# f.write(env.Dump()) f.write(env.Dump())
handleGit() handleGit()
except ValueError as ex: 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." "[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( 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, ex,
) )