TI中文支持网
TI专业的中文技术问题搜集分享网站

DSP6678 intc初始化问题

HI,TI工程师:

问题:

我想实现一个FPGA给DSP GPIO中断,然后触发对应的流程,但是当我调用CSL_intcInit之后,TSK_sleep函数就会一直阻塞在那,什么也不运行。但是如果不调用

CSL_intcInit  TSK_sleep函数就能够正常运行。不知道是什么问题导致的

代码:

/*  全局变量 */

#define LOCAL_INTC_HANDLE_NUM 6

/* Intc variable declarartion */
CSL_CPINTC_Handle hnd;
CSL_IntcContext intcContext;
CSL_IntcEventHandlerRecord EventHandler[30];
CSL_IntcObj intcObj;
CSL_IntcHandle hInctHandle[LOCAL_INTC_HANDLE_NUM];
CSL_IntcGlobalEnableState state;
CSL_IntcEventHandlerRecord EventRecord[LOCAL_INTC_HANDLE_NUM];

/* intc 配置 */

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

/* 中断初始化 */

CSL_IntcParam vectId;
/* 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_13;

hInctHandle[0] = CSL_intcOpen (&intcObj, CSL_GEM_GPINT13, &vectId , NULL);
if (hInctHandle[0] == NULL)
{
printf("Error: GEM-INTC Open failed\n");
return;
}

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

/* Clear the Interrupt */
if (CSL_intcHwControl(hInctHandle[0], CSL_INTC_CMD_EVTCLEAR, NULL) != CSL_SOK)
{
printf("Error: GEM-INTC CSL_INTC_CMD_EVTCLEAR command failed\n");
return;
}

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

kun kun:

补充:我是在 BIOS_start()之前执行上面的代码

赞(0)
未经允许不得转载:TI中文支持网 » DSP6678 intc初始化问题
分享到: 更多 (0)