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.

TMS320C6678: Notify_registerEvent()函数跑飞

Part Number: TMS320C6678

程序运行时,从核(非0核)能顺利执行Notify_registerEvent();但是主核(0核),执行Notify_registerEvent()时跑飞,报错如下。

请问这是什么问题,需要怎么解决?

main()函数如下

Int main(){
Uint16 i = 0; //循环脚标
int status = 0; //各类函数状态返回值

Task_Handle taskHandle; //Task句柄
Task_Params params; //Task参数

/*初始化Task参数*/
Task_Params_init(&params);

/*读取核编号*/
Uint32 COREID = CSL_chipReadReg(CSL_CHIP_DNUM);
printf("Core: %d\n", COREID);

/*核同步*/
status = Ipc_start();
if (status < 0) {
System_abort("Ipc_start failed...\n");
}

if(COREID == MASTERCOREID){
/*主核绑定回调函数,7个从核给主核用Notify通知主核时会触发回调函数*/
for(i = 1; i <= 7; i++){
status = Notify_registerEvent(i, INTERRUPT_LINE, EVENTID, (Notify_FnNotifyCbck)cbFxn, NULL);
printf("Registering call back function from CORE #%d to CORE #%d succeed...\n", i, COREID);
}
/*创建主核任务*/
taskHandle = Task_create(taskFunMaster, &params, NULL);
if(taskHandle == NULL){
System_abort("Creating master core task failed...\n");
}
}
else{
/*从核绑定回调函数,主核用Notify通知7个从核核时会触发回调函数*/
status = Notify_registerEvent(MASTERCOREID, INTERRUPT_LINE, EVENTID, (Notify_FnNotifyCbck)cbFxn, NULL);
printf("Registering call back function from CORE #0 to CORE #%d succeed...\n", COREID);

/*创建从核任务*/
taskHandle = Task_create(taskFunSlave, &params, NULL);
if(taskHandle == NULL){
System_abort("Creating slave core task failed...\n");
}
}

BIOS_start();

return(0);
}

其中INTERRUPT_LINE=0;EVENTID=10;MASTERCOREID=0。

如果将main()函数内容替换成 这一例程中的内容,则程序可以正常运行(.cfg文件应该没问题