Maybe you have a general misconception. The serial monitor in PlatformIO is miniterm.py
. It displays what a serial adapter (you seem to have one at /dev/ttyACM0
) receives via UART. You may be used to semihosting-printf in Keil, which is transported via SWD to the flasher probe, or Segger RTT, but this is not what miniterm.py does or even can do. See also Viewing SWO output within PIO?.