新手上路
- 积分
- 22
- 金钱
- 22
- 注册时间
- 2019-4-27
- 在线时间
- 8 小时
|
在主函数里只放了
#include <stdio.h>
#define ITM_PORT8(n) (*(volatile unsigned char *)(0xe0000000 + 4*(n)))
#define ITM_PORT16(n) (*(volatile unsigned short *)(0xe0000000 + 4*(n)))
#define ITM_PORT32(n) (*(volatile unsigned long *)(0xe0000000 + 4*(n)))
#define DEMCR (*(volatile unsigned long *)(0xE000EDFC))
#define TRCENA 0X01000000
int fputc(int ch, FILE *f)
{
if(DEMCR & TRCENA)
{
while(ITM_PORT32(0) == 0);
ITM_PORT8(0) = ch;
}
return ch;
}
int main(void)
{
printf("\nhello world");
}
然后就出现了以下的问题
..\OBJ\Template.axf: Error: L6200E: Symbol fputc multiply defined (by usart.o and main.o).
Not enough information to produce a FEEDBACK file.
Not enough information to list image symbols.
Not enough information to list the image map.
求助大佬,我应该怎么改才能实现打印功能
|
|