调试uIP出现死机问题
生活随笔
收集整理的這篇文章主要介紹了
调试uIP出现死机问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在調試uIP,加入http功能時,調試出現死循環
原因是所加入的http文件中含有printf等輸出函數,遇到這種情況,有2種解決方法:
1.Keil中勾選“Use MicroLIB”
2.
//加入以下代碼,支持printf函數,而不需要選擇Use MicroLIB
#if 1
#pragma import(__use_no_semihosting)
//標準庫需要支持的函數
struct __FILE
{ int handle;
};
FILE __stdout;
//定義_sys_exit()以避免使用半主機模式
_sys_exit(int x)
{ x = x;
}
//重定義fputc函數
int fputc(int ch, FILE *f)
{ while((USART1->SR&0X40)==0);//循環發送,直到發送完畢USART1->DR = (u8) ch; return ch;
}
#endif
轉載于:https://www.cnblogs.com/season-peng/p/6713510.html
總結
以上是生活随笔為你收集整理的调试uIP出现死机问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 大家有人知道“日不落酒店”这部电影吗
- 下一篇: url中去掉index.php,方便re