基于STM32的多种printf用法,你都知道吗?

https://www.sohu.com/a/322868919_505803

https://blog.csdn.net/ybhuangfugui/article/details/94378276

在IAR中使用 printf() 在IO terminal中打印的方案:

1、使用JTAG模式。使能半主机,不要重写fput()

基于STM32的多种printf用法,你都知道吗?

2、使用SWD模式(SWO(TDO/TRACESWO)线需要连接),使用SWO,重写fput()

int fputc(int ch, FILE *f)
{
return (ITM_SendChar(ch));
}

基于STM32的多种printf用法,你都知道吗?