Switch IDF projects to a standalone GDB packages
Note: This change requires PlatformIO Core >=6.1.11a2
This commit is contained in:
+11
-2
@@ -230,7 +230,16 @@ env.Replace(
|
||||
AS="%s-elf-as" % toolchain_arch,
|
||||
CC="%s-elf-gcc" % toolchain_arch,
|
||||
CXX="%s-elf-g++" % toolchain_arch,
|
||||
GDB="%s-elf-gdb" % toolchain_arch,
|
||||
GDB=join(
|
||||
platform.get_package_dir(
|
||||
"tool-riscv32-esp-elf-gdb"
|
||||
if mcu in ("esp32c3", "esp32c6")
|
||||
else "tool-xtensa-esp-elf-gdb"
|
||||
)
|
||||
or "",
|
||||
"bin",
|
||||
"%s-elf-gdb" % toolchain_arch,
|
||||
) if env.get("PIOFRAMEWORK") == ["espidf"] else "%s-elf-gdb" % toolchain_arch,
|
||||
OBJCOPY=join(
|
||||
platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"),
|
||||
RANLIB="%s-elf-ranlib" % toolchain_arch,
|
||||
@@ -282,7 +291,7 @@ env.Append(
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
action=env.VerboseAction(" ".join([
|
||||
'"$PYTHONEXE" "$OBJCOPY"',
|
||||
'"$PYTHONEXE" "$OBJCOPY"',
|
||||
"--chip", mcu, "elf2image",
|
||||
"--flash_mode", "${__get_board_flash_mode(__env__)}",
|
||||
"--flash_freq", "${__get_board_f_flash(__env__)}",
|
||||
|
||||
+13
-1
@@ -63,6 +63,18 @@
|
||||
"owner": "platformio",
|
||||
"version": "~1.23500.0"
|
||||
},
|
||||
"tool-xtensa-esp-elf-gdb": {
|
||||
"type": "debugger",
|
||||
"optional": true,
|
||||
"owner": "espressif",
|
||||
"version": "~12.1.0+20221002"
|
||||
},
|
||||
"tool-riscv32-esp-elf-gdb": {
|
||||
"type": "debugger",
|
||||
"optional": true,
|
||||
"owner": "espressif",
|
||||
"version": "~12.1.0+20221002"
|
||||
},
|
||||
"framework-arduinoespressif32": {
|
||||
"type": "framework",
|
||||
"optional": true,
|
||||
@@ -79,7 +91,7 @@
|
||||
"type": "framework",
|
||||
"optional": true,
|
||||
"owner": "platformio",
|
||||
"version": "~3.50101.0",
|
||||
"version": "~3.50100.0",
|
||||
"optionalVersions": ["~3.40405.0"]
|
||||
},
|
||||
"tool-esptoolpy": {
|
||||
|
||||
+17
-1
@@ -56,7 +56,7 @@ class Espressif32Platform(PlatformBase):
|
||||
"board_build.core", board_config.get("build.core", "arduino")
|
||||
).lower()
|
||||
|
||||
if len(frameworks) == 1 and "arduino" in frameworks and build_core == "esp32":
|
||||
if frameworks == ["arduino"] and build_core == "esp32":
|
||||
# In case the upstream Arduino framework is specified in the configuration
|
||||
# file then we need to dynamically extract toolchain versions from the
|
||||
# Arduino index file. This feature can be disabled via a special option:
|
||||
@@ -93,6 +93,17 @@ class Espressif32Platform(PlatformBase):
|
||||
sys.exit(1)
|
||||
|
||||
if "espidf" in frameworks:
|
||||
if frameworks == ["espidf"]:
|
||||
# Starting from v12, Espressif's toolchains are shipped without
|
||||
# bundled GDB. Instead, it's distributed as separate packages for Xtensa
|
||||
# and RISC-V targets. Currently only IDF depends on the latest toolchain
|
||||
for gdb_package in ("tool-xtensa-esp-elf-gdb", "tool-riscv32-esp-elf-gdb"):
|
||||
self.packages[gdb_package]["optional"] = False
|
||||
if IS_WINDOWS:
|
||||
# Note: On Windows GDB v12 is not able to
|
||||
# launch a GDB server in pipe mode while v11 works fine
|
||||
self.packages[gdb_package]["version"] = "~11.2.0"
|
||||
|
||||
# Common packages for IDF and mixed Arduino+IDF projects
|
||||
for p in self.packages:
|
||||
if p in ("tool-cmake", "tool-ninja", "toolchain-esp32ulp"):
|
||||
@@ -113,6 +124,11 @@ class Espressif32Platform(PlatformBase):
|
||||
):
|
||||
self.packages["toolchain-%s" % target]["version"] = "12.2.0+20230208"
|
||||
|
||||
if "arduino" in frameworks:
|
||||
# Disable standalone GDB packages for Arduino and Arduino/IDF projects
|
||||
for gdb_package in ("tool-xtensa-esp-elf-gdb", "tool-riscv32-esp-elf-gdb"):
|
||||
self.packages.pop(gdb_package, None)
|
||||
|
||||
for available_mcu in ("esp32", "esp32s2", "esp32s3"):
|
||||
if available_mcu == mcu:
|
||||
self.packages["toolchain-xtensa-%s" % mcu]["optional"] = False
|
||||
|
||||
Reference in New Issue
Block a user