The question is very similar to this one:
I'd like to to printf debugging via the ST-LINK adapter and JTAG, not SWD, in IAR Workbench. Is this possible?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
No. JTAG requires that the clock stops, and then you dump the registers and other states. In the similar question, that was using USB so you could get information from the running system by sending text via CDC, since it looks like a serial port.
I haven't used the most recent IAR workbench, but due to the architecture of JTAG, you would probably have to get "printf" style information out of the UART. You could use JTAG to copy information to a spot in memory, and then dump that memory segment when the clock restarts.
Yes, its physically possible. The mechanism might be different since SWD support multiplexing the pin with SWO/ITM, but I've not checked what is actually implemented in STM32. Its possible to use the same semi-hosting technique from pre-SWD days - this will need JTAG to keep polling for activity.
You might find that the JTAG approach uses halting debug, but for an STM32 part, JTAG supports the same access properties as SWD (memory mapped access rather than direct to a TAP controller in the core).