for an st-link, you can literally debug away as it is swd. otherwise, normally serial is accessible as usb serial available in both official core and libmaple core. i.e. connect usb, Serial.print() outputs to the serial monitor
to use st-link for serial printing i think you may need swo, that isn't quite often done (so far no one has reported trying it here), but i think it can be done.
libmaple don't have it supported in the core i think. i'm not sure about official core for swo use,but it may be available in the cmsis library linked. i think it is a different api from Serial.print() as well.
the original st-link v2 probably has a serial com port in it, but based on the documents it apparently requires connecting to a uart port on the board (e.g. PA9, PA10)
https://www.st.com/resource/en/applicat ... 354244.pdf
to an extent using a st-link serial uart for debugging is the same as if you use another usb-serial (uart) dongle to connect to the uart port. debug can then be achieved quite easily by printing to the uart serial port e.g. Serial1 (pa9, pa10) in libmaple that is. i've not tested it on official core.
if you are using libmaple core as well, thiere is an example sketch which can turn another stm32f103 (e.g. pill / maple mini) board into a usb-serial dongle.
https://github.com/rogerclarkmelbourne/ ... -w-signals
you may want to deactivate the esp8266 command processor as shown in the readme
https://github.com/rogerclarkmelbourne/ ... -over-uart
it is possible to have both core official + libmaple co-exist in the Arduino IDE