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.

DSP6678 can not run gpio0Isr


i set a gpio0 interrupt ,and set a counter to write down the times of GPIO0 interrupts.
however , after i downloaded the .out on the DSP6678 , and run . i found the program fell into a csl_intcIsrdispatch and the couter value is 2. it indicates that the interrupt function only executes twice .I think the interrupt function should execute many times .how to explain this phenomenon?
my code is below attached,Is thers some wrong with my code ? thanks .

vect.asm
;--------------------------------------------------------------

;reference to the externally defined ISR
.ref _c_int00
.ref SRIO_Doorbell_ISR
.ref SRIO_Message_ISR
.ref Exception_service_routine
.ref exception_record
.global vectors

;--------------------------------------------------------------
.sect ".text"
;create interrupt vector for NMI
NMI_ISR:
STW B1,*-B15[1]

;save some key registers when exception happens
MVKL exception_record,B1
MVKH exception_record,B1

STW B3, *+B1[0]
STW A4, *+B1[1]
STW B4, *+B1[2]
STW B14, *+B1[3]
STW B15, *+B1[4]

;jump to exception service routine
MVKL Exception_service_routine, B1
MVKH Exception_service_routine, B1
B B1

LDW *-B15[1],B1
NOP 4

;--------------------------------------------------------------
;create interrupt vector for reset (interrupt 0)
VEC_RESET .macro addr
MVKL addr,B0
MVKH addr,B0
B B0
MVC PCE1,B0
NOP 4
.align 32
.endm

;create interrupt vector for other used interrupts
VEC_ENTRY .macro addr
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 4
.align 32
.endm

;create interrupt vector for unused interrupts
VEC_DUMMY .macro
unused_int?:
B unused_int? ;dead loop for unused interrupts
NOP 5
.align 32
.endm


;--------------------------------------------------------------
;interrupt vector table
.sect "vecs"
.align 1024

vectors:
VEC_RESET _c_int00 ;RESET
VEC_ENTRY NMI_ISR ;NMI/Exception
VEC_DUMMY ;RSVD
VEC_DUMMY ;RSVD
VEC_ENTRY SRIO_Doorbell_ISR ;interrupt 4
VEC_ENTRY SRIO_Message_ISR ;interrupt 5
VEC_DUMMY
VEC_DUMMY ;interrupt 7
VEC_DUMMY ;interrupt 8
VEC_DUMMY ;interrupt 9
VEC_DUMMY ;interrupt 10
VEC_DUMMY ;interrupt 11
VEC_DUMMY ;interrupt 12
VEC_DUMMY ;interrupt 13
VEC_DUMMY ;interrupt 14
VEC_DUMMY ;interrupt 15

.end


void setgpio()
{


CSL_GpioHandle hGpio;
CSL_IntcContext intcContext;
CSL_IntcEventHandlerRecord EventHandler[3];
CSL_IntcObj intcObj0, intcobj8;
CSL_IntcHandle hTest0;
CSL_IntcGlobalEnableState state;
CSL_IntcEventHandlerRecord EventRecord0, EventRecord8;
CSL_IntcParam vectId;

Uint8 bankNum = 0;
// Open the CSL GPIO Module 0
hGpio = CSL_GPIO_open (0);
// Enable GPIO per bank interrupt for bank zero
CSL_GPIO_bankInterruptEnable (hGpio, bankNum);
CSL_GPIO_setRisingEdgeDetect (hGpio, 0); // Set interrupt detection on GPIO pin 1 to rising edge
CSL_GPIO_setPinDirInput ( hGpio, 0 ) ; //set pin as input
intcContext.eventhandlerRecord = EventHandler;
intcContext.numEvtEntries = 3;
if (CSL_intcInit(&intcContext) != CSL_SOK)
{
return;
}

if (CSL_intcGlobalNmiEnable() != CSL_SOK)
{/* Enable NMIs */
return;
}
if (CSL_intcGlobalEnable(&state) != CSL_SOK)
{ /* Enable global interrupts */
return;
}

/* Open the INTC Module for Vector ID: 4 and Event ID: 90 (GPIO_n in C6678)*/
vectId = CSL_INTC_VECTID_6; //
hTest0 = CSL_intcOpen (&intcObj0, 90, &vectId , NULL);
if (hTest0 == NULL)
{
return;
}

EventRecord0.handler = &gpio0_Isr; //bind interupt function to gpio0 interrupt
// EventRecord0.arg = 0;
EventRecord0.arg = hTest0;
if (CSL_intcPlugEventHandler(hTest0,&EventRecord0) != CSL_SOK)
{
return;
}
if (CSL_intcHwControl(hTest0,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)
{
return;
}
printf ("Debug: gpio0 int config Completed\n");

}

volatile int gio0Cnt=0;
interrupt void gpio0_Isr()
{
gio0Cnt++;
}