功能是读取GPS信息,然后通过串口打印出来。
FinSH用的串口1,GPS用的串口3。通过串口调试工具 定时发送自定义打印GPS数据的命令,时间设定100ms。短则几秒钟,长则不到1分钟。都会输出 stack overflow,或是不响应命令(死机)。
用的是CH32V203官方库里面的rtthread例子,在上面添加的功能。
正常响应
msh >print_gps
GPS status = 1
GPS UTC Time 2023-9-12 8:54:20
栈溢出
msh >pthread:GPS stack overflow
thread pri status sp stack size max used left tick error
------ --- ------- ---------- ---------- ------ ---------- ---
GPS 13 ready 0x00000ad8 0x00000200 71% 0x00000004 000
tshell 11 suspend 0x00000120 0x00000400 53% 0x00000004 000
tidle 15 ready 0x00000090 0x00000200 68% 0x00000003 000
main 5 suspend 0x000000f0 0x00000200 46% 0x0000000d 000
增加栈大小后还是溢出
msh >prthread:GPS stack overflow
thread pri status sp stack size max used left tick error
------ --- ------- ---------- ---------- ------ ---------- ---
GPS 13 ready 0x00001cd8 0x00001400 07% 0x00000005 000
tshell 11 suspend 0x00000120 0x00000400 50% 0x00000001 000
tidle 15 ready 0x00000090 0x00000200 68% 0x00000004 000
main 5 suspend 0x000000f0 0x00000200 59% 0x0000000d 000
msh >printhread:GPS stack overflow
thread pri status sp stack size max used left tick error
------ --- ------- ---------- ---------- ------ ---------- ---
GPS 13 ready 0x000031e4 0x00002788 03% 0x00000001 000
tshell 11 suspend 0x00000110 0x00000400 48% 0x0000000a 000
tidle 15 ready 0x00000090 0x00000200 68% 0x0000001d 000
main 5 suspend 0x000000f0 0x00000200 46% 0x0000000d 000