Lab9 卡在奇怪的地方

138 views
Skip to first unread message

張耀仁

unread,
Mar 7, 2013, 9:59:11 AM3/7/13
to embedd...@googlegroups.com
不知有沒人跟我一樣
我現在可以把task我現在可以把改成co-routine

現在可以將LED閃爍
輸出Hello 1, Hello 2到RS232
但是程式就卡住了= =

只要我有輸出的那個co routine就會卡住
(沒有的話可以一直閃爍)
就會看到 LED off 然後再 rs232 那邊就是
Hello 1
          Hello 2 這樣
原本以為卡在 while (!xQueueReceive(serial_str_queue, &msg, portMAX_DELAY));
 我用GDB去debug 發現應該不是= =
我找不出來了QQ

有沒有大神知道是怎麼回事 或是友人跟我一樣嗎~
 

Jim Huang

unread,
Mar 7, 2013, 9:25:28 PM3/7/13
to embedd...@googlegroups.com
co-routine 與 task 最大的差異在於,後者有獨立的 context,而前者沒有。
於是都變成了共享的資源,要很小心處理

Hint: 將 breakpoint 定在 Ready list

張耀仁

unread,
Mar 8, 2013, 3:12:49 AM3/8/13
to embedd...@googlegroups.com
嗯嗯,所以我以為他卡在某一個co-routine裡面當機了才想去debug
結果找不到QQ

可以弱弱的問一下 ready list是指什麼嗎><

jserv於 2013年3月8日星期五UTC+8上午10時25分28秒寫道:

Jim Huang

unread,
Mar 8, 2013, 3:31:18 AM3/8/13
to embedd...@googlegroups.com
在 2013年3月8日下午4:12,張耀仁 <aute...@gmail.com> 寫道:
> 嗯嗯,所以我以為他卡在某一個co-routine裡面當機了才想去debug
> 結果找不到QQ
>
> 可以弱弱的問一下 ready list是指什麼嗎><

請見: FreeRTOS by Christopher Svec
http://www.aosabook.org/en/freertos.html
Reply all
Reply to author
Forward
0 new messages