你的项目没错解决办法在usart.c文件大约50行左右加入一个函数//__use_no_semihosting was requested, but _ttywrch was_ttywrch(int ch){ch = ch;}或者勾选微库就可以解决上述问题主要的原因可能是输出函数的重定向引起的,具体的原因不是很确定。下面的这几句话是KEIL官网上给出的解释Defined in rt_sys.h, the _ttywrch() function writes a character to the console.The console might have been redirected. You can use this function as a last resort error handling routine原文链接:https://blog.csdn.net/andrewgithub/java/article/details/75269233