I'm trying to move away from doing my firmware development in Eclipse GNU MCU for several reasons, mostly related to project maintainability (much easier to integrate CMake such that there is only one build system), and also for better Intellisense etc.
I seem to have most of everything working, except I can't seem to find any way to send commands via semihosting. Basically I have a command line interface to the embedded system via semihosting, where I can do things like command IOs on/off etc etc, which is a big help in debugging.
Now that I've got my basic configuration set up, what happens when I start my debug session is that the code compiles, is flashed (via OpenOCD with STLink), and the debug session starts, halted at the entry point. When I then continue, I see the semihosting output in the "Output/Adapter Output", which holds the as expected OpenOCD console. However, if I try to write text to enter a command (which is how it works under Eclipse), I get "Cannot edit in read-only editor".
I've attached a screen cap to show what I mean, the last three lines are output from my console running in the embedded device:
If I run OpenOCD and arm-none-eabi-gdb separately in terminal, I can write to the OpenOCD console, so it seems that the Cortex-Debug extension needlessly makes the window read-only under VSCode.
Is there any way to use bidirectional semihosting in VSCode? Even a workaround, such as connecting to OpenOCD via telnet
(or rather nc
) will do (I've tried, but writing commands there also don't seem to go to the semihosting pipe), if this can't be done directly in VSCode. Or sending text to semihosting via the GDB console, which does allow writing. However, running gdb and OpenOCD completely separately is not a solution, since then I don't get any of the other debugging features in VSCode.
I'm on OS X Mojave and VSCode, Cortex-Debug and OpenOCD are the newest versions at the time of writing.
Please let me know if this not the right SE, I suppose this could go to Stack Overflow or even SuperUser, but I though this is the right place since the question is very embedded-systems specific.