@@ -54,7 +54,7 @@ def configure_default_packages(self, variables, targets):
54
54
# Install all tools and toolchains
55
55
self .packages ["tl-install" ]["optional" ] = True
56
56
for p in self .packages :
57
- if p in ("tool-mklittlefs" , "tool-mkfatfs" , "tool-mkspiffs" , "tool-dfuutil" , "tool-openocd" , "tool-cmake" , "tool-ninja" , "tool-cppcheck" , "contrib-piohome" , "contrib-pioremote" , "tc-ulp" , "tc-rv32" , "tl-xt-gdb" , "tl-rv-gdb" ):
57
+ if p in ("tool-mklittlefs" , "tool-mkfatfs" , "tool-mkspiffs" , "tool-dfuutil" , "tool-openocd" , "tool-cmake" , "tool-ninja" , "tool-cppcheck" , "tool-clangtidy" , "tool-pvs-studio" , " contrib-piohome" , "contrib-pioremote" , "tc-ulp" , "tc-rv32" , "tl-xt-gdb" , "tl-rv-gdb" ):
58
58
tl_path = "file://" + join (IDF_TOOLS_PATH_DEFAULT , "tools" , p )
59
59
self .packages [p ]["optional" ] = False
60
60
self .packages [p ]["version" ] = tl_path
@@ -63,6 +63,19 @@ def configure_default_packages(self, variables, targets):
63
63
if p in ("tool-cmake" , "tool-ninja" , "tc-ulp" ):
64
64
self .packages [p ]["optional" ] = False if "espidf" in frameworks else True
65
65
66
+ # Enable debug tool gdb only when build debug is enabled
67
+ if variables .get ("build_type" ) or "debug" in "" .join (targets ):
68
+ self .packages ["tl-rv-gdb" ]["optional" ] = False if mcu in ["esp32c2" , "esp32c3" , "esp32c6" , "esp32h2" ] else True
69
+ self .packages ["tl-xt-gdb" ]["optional" ] = False if not mcu in ["esp32c2" , "esp32c3" , "esp32c6" , "esp32h2" ] else True
70
+ else :
71
+ self .packages ["tl-rv-gdb" ]["optional" ] = True
72
+ self .packages ["tl-xt-gdb" ]["optional" ] = True
73
+
74
+ # Enable check tools only when "check_tool" is set in platformio.ini
75
+ for p in self .packages :
76
+ if p in ("tool-cppcheck" , "tool-clangtidy" , "tool-pvs-studio" ):
77
+ self .packages [p ]["optional" ] = False if str (variables .get ("check_tool" )).strip ("['']" ) in p else True
78
+
66
79
if "arduino" in frameworks :
67
80
self .packages ["framework-arduinoespressif32" ]["optional" ] = False
68
81
self .packages ["framework-arduinoespressif32-libs" ]["optional" ] = False
0 commit comments