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: 无法触发doorbell中断,手动置位system interrupt则可以

Part Number: TMS320C6678

FPGA与6678配置了srio通信,Nwrite和Nread读写没问题。

设置好DSP端interrupt_ctl[0]和ICRR,配置FPGA发出doorbell,6678端触发不了doorbell中断,无法进入中断服务程序,手动置位system interrupt则可以触发中断,

但是观察CCS寄存器窗口可以发现ICSR对应bit已经被置1(实际为0x0020,,即bit5=1),EVTFLAG[0]=0,IFR=0,是否是哪里配置错误,无法正确的路由到INTDSTx映射到系统中断。

实际使用的是INTDST5

查表发现INTDST5对应system interrupt=117

doorbell映射到系统中断配置如下:

CSL_SRIO_SetDoorbellRoute(hSrio, 1);//使用INTDST0-15
for (i = 0; i < 16; i++)
{
    CSL_SRIO_RouteDoorbellInterrupts(hSrio, 0, i, i);//将doorbit i映射到INTDST0-INTDST15
}
请问是什么原因导致无法进入中断服务程序,(cmd中已经为.csl_vect在section中分配了memory)
系统中断配置如下:
/* INTC module initialization */
intcContext.eventhandlerRecord = EventHandler;
intcContext.numEvtEntries      = 10;
if (CSL_intcInit(&intcContext) != CSL_SOK) 
{
    printf("Error: GEM-INTC initialization failed\n");
    return;
}    

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

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

/* Open the INTC Module for Vector ID: 4 and Event ID: 63 (C6678) 59 (C6670) 
    *   Refer to the interrupt architecture and mapping document for the Event ID  (INTC0_OUT3)*/
vectId = CSL_INTC_VECTID_4;
hTest = CSL_intcOpen (&intcObj, 63, &vectId , NULL);//event id=63,host interrupt=3
if (hTest == NULL
{
    printf("Error: GEM-INTC Open failed\n");
    return;
}

/* Register an call-back handler which is invoked when the event occurs. */
EventRecord.handler = &test_isr_handler;
EventRecord.arg = 0;
if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK) 
{
    printf("Error: GEM-INTC Plug event handler failed\n");
    return;
}

/* 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;
}

printf ("Debug: GEM-INTC Configuration Completed\n");

/**************************************************
 ************* CPINTC-0 Configuration ************* 
    **************************************************/

printf ("Debug: CPINTC-0 Configuration...\n");
    
/* Open the handle to the CPINT Instance */
hnd = CSL_CPINTC_open(0);
if (hnd == 0)
{
    printf ("Error: Unable to open CPINTC-0\n");
    return;       
}

/* Disable all host interrupts. */
CSL_CPINTC_disableAllHostInterrupt(hnd);

/* Configure no nesting support in the CPINTC Module. */
CSL_CPINTC_setNestingMode (hnd, CPINTC_NO_NESTING);

/* We now map System Interrupt 0 - 3 to channel 3 */ 
CSL_CPINTC_mapSystemIntrToChannel (hnd, 117 , 3);

/* We now enable system interrupt 0 - 3 */
CSL_CPINTC_enableSysInterrupt (hnd, 117);

/* We enable host interrupts. */
CSL_CPINTC_enableHostInterrupt (hnd, 3);

/* Enable all host interrupts also. */
CSL_CPINTC_enableAllHostInterrupt(hnd);

手动置位中断号则可以触发中断,并且进入中断服务程序

//手动system interrupt 117可以触发中断
((CSL_CPINTC_RegsOvly)CSL_CP_INTC_0_REGS)->STATUS_SET_INDEX_REG = 117;