STM32报错、报错状况以及解决办法:Library reports error: __use_no_semihosting was requested, but _ttywrch was refer

在写STM32程序的时候
①我用到了#include “stdlib.h”这个头文件,里面包括一些malloc、exit、free等函数;
②我是用的正点原子的官方usart函数文件。
在这样的前提下出现错误:
Library reports error: __use_no_semihosting was requested, but _ttywrch was referenced

解决办法:
在usart.c文件的
_sys_exit(int x)
{
x = x;
}
大约47行后面加入
//__use_no_semihosting was requested, but _ttywrch was
_ttywrch(int ch)
{
ch = ch;
}
STM32报错、报错状况以及解决办法:Library reports error: __use_no_semihosting was requested, but _ttywrch was refer_第1张图片

这样就完美解决了!

你可能感兴趣的:(STM32,C语言基础)