引用: zbb9612 发表于 2018-8-6 07:07
你这里的中断嵌套是啥意思?中断会使用system stack,如果是堆栈溢出,可以增加system stack size,如果增大size还是出现问题极有可能不是堆栈溢出导致,并且可以在ccs tools下的mcsa工具查看system stack的使用状态。
我换个问法吧,就是说,我在我的RTOS 工程中使用了外部中断方式来启动TCP协议中的send发送,例程参考的是cpintc.c。
感觉中断设置的不正确,使得程序在send()处阻塞。
我的中断初始化程序及中断服务程序如下,请看一下是否有问题呢?
另外我看到对于RTOS需要在SYS/BIOS中设置中断,我采用CSL API函数设置可以吗?
若不可以,有无相关RTOS配置中断的例程呢?
非常感谢!
中断初始化程序如下”:
void Intc_Init(void)
[
printf ("Debug: GEM-INTC Configuration...n");
/* INTC module initialization */
intcContext.eventhandlerRecord = EventHandler;
intcContext.numEvtEntries = 10;
if (CSL_intcInit(&intcContext) != CSL_SOK)
[
printf("Error: GEM-INTC initialization failedn");
return;
]
/* Enable NMIs */
if (CSL_intcGlobalNmiEnable() != CSL_SOK)
[
printf("Error: GEM-INTC global NMI enable failedn");
return;
]
/* Enable global interrupts */
if (CSL_intcGlobalEnable(&state) != CSL_SOK)
[
printf ("Error: GEM-INTC global enable failedn");
return;
]
/* Open the INTC Module for Vector ID: 4 and Event ID: 88 (C6678) GPIO_14
* Refer to the interrupt architecture and mapping document for the Event ID (INTC0_OUT3)*/
vectId = CSL_INTC_VECTID_4;
hTest = CSL_intcOpen (&intcObj, 88, &vectId , NULL);
if (hTest == NULL)
[
printf("Error: GEM-INTC Open failedn");
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 failedn");
return;
]
/* Enabling the events. */
if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)
[
printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failedn");
return;
]
printf ("Debug: GEM-INTC Configuration Completedn");
]
中断服务程序如下:
void test_isr_handler (void* handle)
[
SPI_Read_Buffer();
l++;
if(l == (ARRAYSIZE/27))
[
l = 0;
flag = 1;
]
]
引用: zbb9612 发表于 2018-8-6 07:07
你这里的中断嵌套是啥意思?中断会使用system stack,如果是堆栈溢出,可以增加system stack size,如果增大size还是出现问题极有可能不是堆栈溢出导致,并且可以在ccs tools下的mcsa工具查看system stack的使用状态。
我换个问法吧,就是说,我在我的RTOS 工程中使用了外部中断方式来启动TCP协议中的send发送,例程参考的是cpintc.c。
感觉中断设置的不正确,使得程序在send()处阻塞。
我的中断初始化程序及中断服务程序如下,请看一下是否有问题呢?
另外我看到对于RTOS需要在SYS/BIOS中设置中断,我采用CSL API函数设置可以吗?
若不可以,有无相关RTOS配置中断的例程呢?
非常感谢!
中断初始化程序如下”:
void Intc_Init(void)
[
printf ("Debug: GEM-INTC Configuration...n");
/* INTC module initialization */
intcContext.eventhandlerRecord = EventHandler;
intcContext.numEvtEntries = 10;
if (CSL_intcInit(&intcContext) != CSL_SOK)
[
printf("Error: GEM-INTC initialization failedn");
return;
]
/* Enable NMIs */
if (CSL_intcGlobalNmiEnable() != CSL_SOK)
[
printf("Error: GEM-INTC global NMI enable failedn");
return;
]
/* Enable global interrupts */
if (CSL_intcGlobalEnable(&state) != CSL_SOK)
[
printf ("Error: GEM-INTC global enable failedn");
return;
]
/* Open the INTC Module for Vector ID: 4 and Event ID: 88 (C6678) GPIO_14
* Refer to the interrupt architecture and mapping document for the Event ID (INTC0_OUT3)*/
vectId = CSL_INTC_VECTID_4;
hTest = CSL_intcOpen (&intcObj, 88, &vectId , NULL);
if (hTest == NULL)
[
printf("Error: GEM-INTC Open failedn");
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 failedn");
return;
]
/* Enabling the events. */
if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)
[
printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failedn");
return;
]
printf ("Debug: GEM-INTC Configuration Completedn");
]
中断服务程序如下:
void test_isr_handler (void* handle)
[
SPI_Read_Buffer();
l++;
if(l == (ARRAYSIZE/27))
[
l = 0;
flag = 1;
]
]
举报