@@ -130,8 +130,6 @@ def _add_dynamic_options(self, board):
130
130
if "openocd_target" in debug
131
131
else ("board" , debug .get ("openocd_board" ))
132
132
),
133
- "-c" ,
134
- "adapter_khz %d" % debug .get ("adapter_speed" , 5000 ),
135
133
]
136
134
137
135
debug ["tools" ][link ] = {
@@ -164,15 +162,22 @@ def _add_dynamic_options(self, board):
164
162
def configure_debug_options (self , initial_debug_options , ide_data ):
165
163
ide_extra_data = ide_data .get ("extra" , {})
166
164
flash_images = ide_extra_data .get ("flash_images" , [])
165
+ debug_options = copy .deepcopy (initial_debug_options )
166
+
167
+ if "openocd" in debug_options ["server" ].get ("executable" , "" ):
168
+ debug_options ["server" ]["arguments" ].extend (
169
+ ["-c" , "adapter_khz %s" % (initial_debug_options .get ("speed" ) or "5000" )]
170
+ )
171
+
167
172
ignore_conds = [
168
173
initial_debug_options ["load_cmds" ] != ["load" ],
169
174
not flash_images ,
170
175
not all ([os .path .isfile (item ["path" ]) for item in flash_images ]),
171
176
]
177
+
172
178
if any (ignore_conds ):
173
- return initial_debug_options
179
+ return debug_options
174
180
175
- debug_options = copy .deepcopy (initial_debug_options )
176
181
load_cmds = [
177
182
'monitor program_esp "{{{path}}}" {offset} verify' .format (
178
183
path = fs .to_unix_path (item ["path" ]), offset = item ["offset" ]
0 commit comments