This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Semaphore : A_badContext

Other Parts Discussed in Thread: SYSBIOS

6678

bios6.34

运行程序的时候出现ti.sysbios.knl.Semaphore: line 207: assertion failure: A_badContext: bad calling context. Must be called from a Task.

因为程序一直跑,整个流程是不断循环的过程,上述错误是在其中某一次时出现的,所以我无法打断点调试出到底哪句出现问题。我在e2e上看到说是semaphore_pend在非task中调用的原因,但我的pend并没有在非task中调用。

我通过printf大概看到出错时大概运行到的地方:

core0的receivetask会触发一个swi,swi的isr中只有一句mailbox_post,这个post激活core0中sendtask中的pend,然后sendtask通过messageQ_put发消息给core1.

在这个过程中,以及swi中我并没有调用semaphore_pend,事实上core0上我都没有用到semaphore,不知是什么问题?

谢谢!