52832 不使用micro_lib ,同时使用AC6编译器且使用printf问题

1. 因为我的工程用AC6是因为要跑自己的C 和 TensorFlow lite micro. 所以是C,C++混合的工程,但是一直没法打印,所以写一个总结。

基本说明: micro_lib这种情况不要选,因为存在C++文件

第一个坑:

第二个坑:网上大部分教程的重定向printf代码是

__ASM(".global __use_no_semihosting");

//??HAL????,?????????bug
//??????????,???????????????,??
int _ttywrch(int ch)    
{
    ch=ch;
	return ch;
}

//??????????                 
//struct __FILE 
//{ 
//	int handle; 
//	/* Whatever you require here. If the only file you are using is */ 
//	/* standard output using printf() for debugging, no file handling */ 
//	/* is required. */ 
//}; 

FILE __stdout;     

//??_sys_exit()??????????    
void _sys_exit(int x) 
{ 
	x = x; 
} 

int fputc(int ch, FILE *f){      
   // usart_data_transmit(USART0, (
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值