I meet a question: c6678 uart interrupt conflict with task_sleep in NDK
When I enable the uart interrupt in c6678,with NDK, the task_sleep will not work.,but if I not use the interrupt ,then the task_sleep will work well.
/////////////////////////////my uart interrupt code/////////////////////////////////////////////////////////////////////
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);
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, 0 , 2);
//CSL_CPINTC_mapSystemIntrToChannel (hnd, 1 , 4);
//CSL_CPINTC_mapSystemIntrToChannel (hnd, 2 , 5);
CSL_CPINTC_mapSystemIntrToChannel (hnd, SYSTEM_INTERRUPT , 3);
/* We now enable system interrupt 0 - 3 */
//CSL_CPINTC_enableSysInterrupt (hnd, 0);
//CSL_CPINTC_enableSysInterrupt (hnd, 1);
//CSL_CPINTC_enableSysInterrupt (hnd, 2);
CSL_CPINTC_enableSysInterrupt (hnd, SYSTEM_INTERRUPT);
/* We enable host interrupts. */
CSL_CPINTC_enableHostInterrupt (hnd, 3);
/* Enable all host interrupts also. */
CSL_CPINTC_enableAllHostInterrupt(hnd);
printf ("Debug: CPINTC-0 Configuration Completed\n");
/* Testing the CSL API. */
printf ("***************************************\n");
printf ("Testing the CSL API for CPINTC-0 \n");
printf ("****************************************\n");
////////////////////////////////////////////////////////////////////////////////////////////////////////
If I run this code, the UART interrupt work well , but task_sleep will not work.
If I didn't call this code ,the task_sleep will work well
I think I have crash the timer of sysbios tick,but I don't know how to fix this bug