Steps to reproduce:
- Mbed Studio 1.3.0 on Windows 10:
- Open the “Manage Custom Targets” dialog box.
- Choose a USB device and fill in the fields.
- In the “Debug flags” field, manually enter a flag containing a space character, e.g.
--packfollowed by a path containing a space character.
- Start the debugger.
Result in the Debug Console:
Selected port 50000 for debugging
usage: pyocd [-h] [-V] [–help-options] …
pyocd: error: unrecognized arguments: <portion of the path following the space character>
“GDB server stopped unexpectedly with exit code 2”
I’ve tried single- and double-quoting, escaping,
%20, but nothing seems to be working.
However, if this field is not filled manually, but automatically after selecting a “Deploy and debug target”, then there is no issue, even though this field contains in this case a
--pack c:\ProgramData\Mbed Studio\mbed-studio-tools\cmsis-packs\<something>.pack, so an instance of a flag with a space character, not even quoted. Actually, in this case,
debugFlags is empty in
custom_targets.json, so the displayed debug flags must come from the CMSIS pack.
There is also no way of specifying a custom CMSIS pack path in “Deploy and debug target”.
The only workaround is to edit