Using AM5728 GP EVM. SYS/BIOS on DSP core, Linux on ARM core. IPC 3.42.0002
Just starting to integrate MessageQ between ARM and DSP. We can get the ARM to load the DSP but when IpcMgr_ipcStartup executes, the DSP crashes.
Specifically I see the error:
ti. sysbios .knl.Semaphore: ERROR: line 202: assertion failure: A_badContext: bad calling context. Must be called from a Task
I have traced this to the following code from the function RPMessage_send():
/* Send to remote processor: */
do {
token = VirtQueue_getAvailBuf(transport.virtQueue_toHost,
(Void **)&msg, &length);
} while (token < 0 && Semaphore_pend(transport.semHandle_toHost,BIOS_WAIT_FOREVER));
The obvious problem is that for some reason token is -1. I have not been able to figure out why that would be the case. The side effect of token = -1 is that the Semaphore_pend() function is then called. Since IpcMgr_ipcStartup is called from BIOS_Startup and not in a task, the Semaphore_pend function crashes. If token returned >= 0 the first time, the Semaphore_pend function is never called, so this would not be noticed. This seems like a bug to me.
I then tried to move the IpcMgr_ipcStartup function to a task. As expected, token is still -1, Semaphore_pend no longer crashes, but the code ends up stuck in that loop, since no one else ever posts to that semaphore. That also seems like a bug.
So, I guess I could use some help with two things here. How can I troubleshoot why token = -1 and can someone comment on the Semaphore_pend issue I am seeing.