From f2a5977c918e837aeafd09151f4e3ea1a7ead90c Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Fri, 29 Jul 2022 17:53:19 +0300 Subject: [PATCH] Properly propagate additional data to configure debug session - Add extra data to "projenv" as well so that the extra data it can be overridden after the BuildProgram routine - Use the new INTEGRATION_EXTRA_DATA env variable instead of IDE_EXTRA_DATA --- builder/frameworks/arduino.py | 2 +- builder/frameworks/espidf.py | 2 +- builder/main.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index c6fc754..eea32aa 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -41,4 +41,4 @@ elif "espidf" not in env.subst("$PIOFRAMEWORK"): SConscript( join(DefaultEnvironment().PioPlatform().get_package_dir( "framework-arduinoespressif32"), "tools", "platformio-build.py")) - env["IDE_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")}) + env["INTEGRATION_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")}) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index 59f6809..a80a616 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -1470,4 +1470,4 @@ env.Replace( ) # Propagate application offset to debug configurations -env["IDE_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")}) +env["INTEGRATION_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")}) diff --git a/builder/main.py b/builder/main.py index 19d88b3..5940c31 100644 --- a/builder/main.py +++ b/builder/main.py @@ -169,6 +169,9 @@ filesystem = board.get("build.filesystem", "spiffs") if mcu == "esp32c3": toolchain_arch = "riscv32-esp" +if "INTEGRATION_EXTRA_DATA" not in env: + env["INTEGRATION_EXTRA_DATA"] = {} + env.Replace( __get_board_boot_mode=_get_board_boot_mode, __get_board_f_flash=_get_board_f_flash, @@ -501,6 +504,13 @@ if any("-Wl,-T" in f for f in env.get("LINKFLAGS", [])): print("Warning! '-Wl,-T' option for specifying linker scripts is deprecated. " "Please use 'board_build.ldscript' option in your 'platformio.ini' file.") +# +# A temporary workaround to propagate additional data to the debug configuration routine +# + +Import("projenv") +projenv["INTEGRATION_EXTRA_DATA"] = env.get("INTEGRATION_EXTRA_DATA") + # # Default targets #