我正在使用STM32上的FreeRTOS开发多线程应用程序。 当我尝试使用OpenOCD和gdb调试它时,我可以使用所有线程但我的主循环。
>>> info threads
Id Target Id Frame
6 Thread 536892936 (cli) vTaskSuspend (xTaskToSuspend=<optimized out>) at /home/user1273684/dev/firmware/module/FreeRTOS/Source/tasks.c:1620
5 Thread 536888728 (wifi_loop) vTaskSuspend (xTaskToSuspend=<optimized out>) at /home/user1273684/dev/firmware/module/FreeRTOS/Source/tasks.c:1620
4 Thread 536884824 (Tmr Svc) xTaskResumeAll () at /home/user1273684/dev/firmware/module/FreeRTOS/Source/tasks.c:2126
3 Thread 536905240 (main_loop) 0x00000000 in ?? ()
2 Thread 536879832 (wifi_watchdog) xTaskResumeAll () at /home/user1273684/dev/firmware/module/FreeRTOS/Source/tasks.c:2126
* 1 Thread 536882960 (IDLE : : Running) prvIdleTask (pvParameters=<optimized out>) at /home/user1273684/dev/firmware/module/FreeRTOS/Source/tasks.c:3145
>>> thread 3
[Switching to thread 3 (Thread 536905240)]
#0 0x00000000 in ?? ()
>>> bt
#0 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
我尝试增加堆栈大小(vTaskList()
表示剩余空间很大,configCHECK_FOR_STACK_OVERFLOW
设置为2而vApplicationStackOverflowHook()
永远不会被触发)但没有任何变化。
2017-06-20 10:34:34,217 - INFO # cli R 1 922 5
2017-06-20 10:34:34,217 - INFO # IDLE R 0 235 2
2017-06-20 10:34:34,218 - INFO # wifi_watchdog B 1 231 8
2017-06-20 10:34:34,218 - INFO # main_loop B 2 2879 6
2017-06-20 10:34:34,218 - INFO # Tmr Svc S 4 320 3
2017-06-20 10:34:34,218 - INFO # wifi_loop S 3 627 4
这里发生了什么?