(1)在调usart.c文件的时候出现下面错误:
L6915E: Library reports error: __use_no_semihosting was requested, but _ttywrch was referenced Not enough information to list load addresses in the image map.
解决办法:
//加入以下代码,支持printf函数,而不需要选择use MicroLIB
#if 1
#pragma import(__use_no_semihosting)
//标准库需要的支持函数
struct __FILE
{
int handle;
};
FILE __stdout;
//定义_sys_exit()以避免使用半主机模式
_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((USART1->SR&0X40)==0);//循环发送,直到发送完毕
USART1->DR = (u8) ch;
return ch;
}
#endif
问题解决:

这篇博客总结了在MDK环境下遇到的各种编译错误,包括L6915E关于_usart.c_的错误,L6218E关于未定义的__aeabi_assert,L6218E关于undefined symbol的错误,L6200E关于multiply defined的错误,并给出了详细的解决办法,如检查符号定义、避免头文件重复包含和正确使用extern关键字。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



