diff --git a/platform.json b/platform.json index ea73510..6d6074c 100644 --- a/platform.json +++ b/platform.json @@ -32,7 +32,10 @@ "toolchain-sdcc": { "type": "toolchain", "owner": "platformio", - "version": "~1.40100.0" + "version": "~1.40100.0", + "optionalVersions": [ + "~1.30901.0" + ] }, "framework-arduinoststm8": { "type": "framework", diff --git a/platform.py b/platform.py index a4e14a7..0e3f217 100644 --- a/platform.py +++ b/platform.py @@ -17,6 +17,11 @@ class Ststm8Platform(PlatformBase): + def configure_default_packages(self, variables, targets): + if "arduino" in variables.get("pioframework", []): + self.packages["toolchain-sdcc"]["version"] = "~1.30901.0" + return PlatformBase.configure_default_packages(self, variables, targets) + def get_boards(self, id_=None): result = PlatformBase.get_boards(self, id_) if not result: @@ -38,6 +43,8 @@ def _add_default_debug_tools(self, board): # Configure OpenOCD debugging. # Only via ST-Link for now for link in ("stlink",): + if link not in upload_protocols or link in debug["tools"]: + continue if link == "stlink": server_args = ["-s", "$PACKAGE_DIR/scripts"] if debug.get("openocd_board"):