Have you considered using RTT? It might require a slight change on the SimpleFOC desktop app to connect (since JLink exposes a telnet port, not a serial port), but I’ve been making extensive use of the RTTStream arduino library, which exposes Segger RTT as a regular Stream object (like Serial).
As a result, you can just hand it to SimpleFOC. I haven’t tried it as a commander input, but it works fine with the Monitor feature so far:
#include <RTTStream.h>
RTTStream rtt;
void setup(){
...
motor.useMonitoring(rtt);
...
rtt.println("Setup done!");
}
Obviously you need a jlink swd connection, but if you’ve already got one for your micro it means you don’t need to do anything extra. You can interact and log files via the J-Link RTT Viewer app, or open up Jlink itself (the command line tool), and chose connect, and choose the default params aside from selecting “SWD” rather than the default JTAG.
Once that’s connected it exposes a telnet socket (socket://localhost:19021 in my case), which PlatformIO is happy enough to use as a serial terminal. (monitor_port = socket://localhost:19021 in platformio.ini).
The advantage is that at least as far as I can tell the RTT lib is fairly light weight, and supports multiple virtual serial channels over your existing SWD connection. It’s also fairly fast and low impact (allegedly I haven’t confirmed this).