Part Number: TMS320C6657
Other Parts Discussed in Thread: SYSBIOS
Hi All,
i am trying to get one external interrupt(from FPGA) to DSP(C6657). i want to call Testfun(), whenever the interrupt comes. but the when i give the interrupt from FPGA it comes to the DSP on GPIO 3, verified by
CSL_GPIO_getInputData(g_hGpio,2,&uTestpin), where i verifed the interrupt comes to the GPIO Pin 2(GPIO2). But the function,Testfun() is not invoked. this is my code, can any body tell, where the problem is.
#define KICK0 (*(unsigned int*)(0x02620038))
#define KICK1 (*(unsigned int*)(0x0262003C))
#define KICK0_KEYVAL 0x83e70b13
#define KICK1_KEYVAL 0x95a4f1e0
#define PIN_CONTROL_0 (*(unsigned int*)(0x02620580))
g_hGpio = CSL_GPIO_open(0);
(1)//unlock boot cfg registers and configure GPIO pin 0-15 mux
KICK0 = KICK0_KEYVAL;
KICK1 = KICK1_KEYVAL;
//Configuring the chip_pin_control0 register
PIN_CONTROL_0 = 0xFFFFFFFF;
(2)CSL_GPIO_bankInterruptEnable(g_hGpio, 0); //BINTEN 1 for bit '0'
(3)Set direction and rising or falling edge detection.
//0 to 3 //pin 0 to 3
for (Uint8 u8Pin = g_u8GpioPin00; u8Pin <= g_u8GpioPin03; u8Pin++)
{
CSL_GPIO_setPinDirInput(g_hGpio,u8Pin);
CSL_GPIO_setRisingEdgeDetect(g_hGpio,u8Pin);
CSL_GPIO_setFallingEdgeDetect(g_hGpio,u8Pin);
}
(4)
/ Set HW Interrupt
Hwi_Params hwiParams;
Hwi_Params_init(&hwiParams);
hwiParams.enableInt = 1;
// set the argument you want passed to your ISR function
hwiParams.arg = 1;
// set the event id of the peripheral assigned to this interrupt
hwiParams.eventId = 73; //event number mapped to GPIO 2
hwiParams.priority =1;
// don't allow this interrupt to nest itself
hwiParams.maskSetting = Hwi_MaskingOption_SELF;
myHwi = Hwi_create(3, (ti_sysbios_hal_Hwi_FuncPtr) &TestFunc, &hwiParams, &eb);
if (Error_check(&eb)) {
printf("CMain::CMain(): Hwi_create failed.\n");
//TestFunc() which is not invoking.when i am toggling the interrupt from FPGA,
void TestFunc()
´{
int Test = 0;
}
Thanks,
Ramana.