1、## keil mdk 编译弹窗错误:browse information of one or more files is not available
重新将C文件、H文件添加到工程即可。
2、MDK—— Error: L6915E: Library reports error: __use_no_semihosting was requested
错误:
Error: L6915E: Library reports error: __use_no_semihosting was requested, but _ttywrch was referenced
解决:
usart.c文件中串口重定位增加
//__use_no_semihosting was requested, but _ttywrch was
_ttywrch(int ch)
{
ch = ch;
}
//
//加入以下代码,支持printf函数,而不需要选择use MicroLIB
#if 1
#pragma import(__use_no_semihosting)
//标准库需要的支持函数
struct __FILE
{
int handle;
};
FILE __stdout;
//定义_sys_exit()以避免使用半主机模式
void _sys_exit(int x)
{
x = x;
}
//__use_no_semihosting was requested, but _ttywrch was
_ttywrch(int ch)
{
ch = ch;
}
//重定义fputc函数
int fputc(int ch, FILE *f)
{
while((USART6->SR&0X40)==0);//循环发送,直到发送完毕
USART6->DR = (u8) ch;
return ch;
}
#endif