struct __FILE
{
int handle;
};
FILE __stdout;
//定义_sys_exit()以避免使用半主机模式
_sys_exit(int x)
{
x = x;
}
//重定义fputc函数
int fputc(int ch, FILE *f)
{
while(USART_GetFlagStatus(USART3,USART_FLAG_TC)==RESET){};
USART_SendData(USART3,(uint8_t)ch);
return ch;
}
你试试 这个是我在stm32上面用可以的
|