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.

请教一下SRIO中doorbell中断配置问题



例程里采用的是直接配置寄存器,然后通过直接配置寄存器,然后在SRIO_vectors.asm文件里完成中断服务函数入口的映射。 现在我想在我的程序里利用CSL库函数来完成这一配置。下面是我的代码

int intc_ini(CSL_IntcEventHandler func)
{
//// /* INTC module initialization */

#ifdef CSL
CSL_IntcContext intcContext;
CSL_IntcEventHandlerRecord EventHandler[10];
CSL_IntcObj intcObj;
CSL_IntcHandle hTest;
CSL_IntcGlobalEnableState state;
CSL_IntcEventHandlerRecord EventRecord;
CSL_IntcParam vectId;
SRIO_Interrupt_Cfg interrupt_cfg;
////
////
intcContext.eventhandlerRecord = EventHandler;
intcContext.numEvtEntries = 10;
if (CSL_intcInit(&intcContext) != CSL_SOK)
{
printf("Error: GEM-INTC initialization failed\n");
return 0;
}

/* Enable NMIs */
if (CSL_intcGlobalNmiEnable() != CSL_SOK)
{
printf("Error: GEM-INTC global NMI enable failed\n");
return 0;
}

if (CSL_intcGlobalEnable(&state) != CSL_SOK)
{
printf ("Error: GEM-INTC global enable failed\n");
return 0;
}

vectId = CSL_INTC_VECTID_5;
hTest = CSL_intcOpen (&intcObj, 20, &vectId , NULL);
if (hTest == NULL)
{
printf("Error: GEM-INTC Open failed\n");
return 0;
}

EventRecord.handler =func;
EventRecord.arg = 0;
if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK)
{
printf("Error: GEM-INTC Plug event handler failed\n");
return 0;
}

/* Enabling the events. */
if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)
{
printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failed\n");
return 0;
}

}

我在配置好以后,运行程序,每次执行完doorbell以后,程序就跑飞了。。请问这有可能是什么原因啊。 我的程序应该没有其他方面的问题,因为我如果把中断的配置方法采用STK例程中那样做,是可以正确的执行中断服务程序的。