功能是讀取GPS信息,然后通過串口打印出來。
FinSH用的串口1,GPS用的串口3。通過串口調(diào)試工具 定時(shí)發(fā)送自定義打印GPS數(shù)據(jù)的命令,時(shí)間設(shè)定100ms。短則幾秒鐘,長(zhǎng)則不到1分鐘。都會(huì)輸出 stack overflow,或是不響應(yīng)命令(死機(jī))。
用的是CH32V203官方庫里面的rtthread例子,在上面添加的功能。
正常響應(yīng)
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