Here is my attempt to use semihosting with jlink on stm32. Maybe it will be helpful to someone:

First drivers. The one from platfomrio didn’t install, so I needed to install them from segger.
Platformio.ini:
The difference from st-link is to use following debug commands:
debug_extra_cmds =
monitor interface SWD
monitor semihosting enable
monitor semihosting ioclient 3
The output is pretty messy with debugger commands interleaved with prints.
The printing can also be opened on the device monitor which looks better, but the keyboard input doesn’t work there.

Also, I didn’t get testing to work on target with test_testing_command
. I don’t know how this works.

1 Like
cmsis-dap is much better.
It works just like the stlink
with semihosting and testing on the target: