又是奇怪的问题:使用Notify 在core 0和core1 进行通信,core0 向core 1 sendEvent就:event has no registered callback!
core1 给自己sendEvent 就能正常运行!这是为什么?代码如下(其中Ipc_attach的使用部分参考了帖子:e2e.ti.com/support/processors/f/791/p/661148/2429976?tisearch=e2e-quicksearch&keymatch=Ipc.procSync#2429976)
.c code:
#include "EVM_init.h"
uint32_t maxFlashes = 3;
uint32_t EVENTID = 0;
Void cbFxn(UInt16 procId, UInt16 lineId, UInt32 eventId, UArg arg, UInt32 payload)
{
Semaphore_post(semHandle);
}
void ledPlayTask (void)
{
Int status;
uint32_t coreId/*,i=0*/;
coreId = CSL_chipReadReg (CSL_CHIP_DNUM);
/*UInt16 procId;
procId = 2;*/
UInt16 numProcs;
numProcs = MultiProc_getNumProcessors();
switch(coreId)
{
case 0:
platform_write("core %d is working, Dsp num : %d\n",coreId,numProcs);
/*status = Ipc_start();
if (status < 0) {
System_abort("Ipc_start failed\n");
}*/
while(Ipc_attach(1))
{
Task_sleep(1);
}
status = Notify_sendEvent(1, 0, EVENTID, 0, TRUE);
switch(status)
{
case Notify_E_EVTNOTREGISTERED :
platform_write("event has no registered callback \n");
break;
case Notify_E_NOTINITIALIZED :
platform_write("remote driver has not yet been initialized \n");
break;
case Notify_E_EVTDISABLED :
platform_write("remote event is disabled \n");
break;
case Notify_E_TIMEOUT :
platform_write("timeout occurred (when waitClear is TRUE) \n");
break;
case Notify_S_SUCCESS :
platform_write(" event successfully sent \n");
break;
default :
platform_write(" What? \n");
break;
}
break;
case 1:
platform_write("core %d is working, Dsp num : %d\n",coreId,numProcs);
/*status = Ipc_start();
if (status < 0) {
System_abort("Ipc_start failed\n");
}*/
while(Ipc_attach(0))
{
Task_sleep(1);
}
//Task_sleep(10);
//status = Notify_sendEvent(1, 0, EVENTID, 0, TRUE);
/*status = Notify_sendEvent(coreId, 0, EVENTID, 0, TRUE);
switch(status)
{
case Notify_E_EVTNOTREGISTERED :
platform_write("event has no registered callback \n");
break;
case Notify_E_NOTINITIALIZED :
platform_write("remote driver has not yet been initialized \n");
break;
case Notify_E_EVTDISABLED :
platform_write("remote event is disabled \n");
break;
case Notify_E_TIMEOUT :
platform_write("timeout occurred (when waitClear is TRUE) \n");
break;
case Notify_S_SUCCESS :
platform_write(" event successfully sent \n");
break;
default :
platform_write(" What? \n");
break;
}*/
Semaphore_pend(semHandle,BIOS_WAIT_FOREVER);
platform_write("Core %d EVENT HAVE ARRIVED!\n",coreId);
break;
}
}
Int main()
{
UInt16 dsp_id;
Int status;
status = Ipc_start();
if (status < 0) {
System_abort("Ipc_start failed\n");
}
else
{
platform_write("IPC STATUS:%d \n",status);
}
dsp_id = MultiProc_self();
//platform_write("dsp_id is %d \n",dsp_id);
status = Notify_registerEvent(dsp_id, 0, EVENTID,(Notify_FnNotifyCbck)cbFxn, NULL);
if (status < 0) {
System_abort("Notify_registerEvent failed\n");
}
platform_write("Start BIOS 6\n");
BIOS_start(); /* does not return */
return(0);
}
运行到status = Notify_sendEvent(1, 0, EVENTID, 0, TRUE);就返回event has no registered callback,能帮看看为什么吗?