Other Parts Discussed in Thread: SYSBIOS
Hi,
I've just started to use the c6654 for my application, and I have a little problem setting up an interrupt on one of the GPIO handled by the CIC0 system.
As it didn't work the first time using a true input signal of my board, I've setup a test where I trigger the interrupt by setting/clearing the GPIO (configured as output) in my code. It works fine with a GPIO that is directly connected to the core0 (e.g. GPIO12), but doesn't work (myIsr is never called) using a GPIO connected to CIC0 (GPIO 22 in this example).
My code use sysbios and its CpIntc module, and I just copied the sample code in the module documentation :
// in main.c
...
// set interrupt on all GPIOs, so I don't have to bother
// the dir of GPIOs is set to output elsewhere
// GPIO_CLR_RIS_TRIG = 0xFFFFFFFF;
// GPIO_CLR_FAL_TRIG = 0xFFFFFFFF;
GPIO_SET_RIS_TRIG = 0xFFFFFFFF;
GPIO_SET_FAL_TRIG = 0xFFFFFFFF;
GPIO_BITEN = 1 ;
// CIC0 sys event 6 = GPINT22 on c6654, according to datasheet
CpIntc_mapSysIntToHostInt(0, 6, 1);
CpIntc_dispatchPlug(6, &myIsr, 6, TRUE);
// the eventId returned is correct, hostInt 1 = event 23, according to datasheet
int eventId = CpIntc_getEventId(1);
System_printf("event Id = %d\n", eventId);
System_flush();
Error_Block eb;
Error_init(&eb);
Hwi_Params params;
Hwi_Params_init(¶ms);
params.eventId = eventId;
params.arg = 0;
params.enableInt = 1;
Hwi_create(5, &CpIntc_dispatch, ¶ms, &eb);
// I also tried using directly myIsr
//Hwi_create(5, &myIsr, ¶ms, &eb);
BIOS_start(); /* enable interrupts and start SYS/BIOS */
...
GPIO_SET_DATA = 1 << 22;
GPIO_CLR_DATA = 1 << 22;
if I use GPIO12 with the same code, using event86(according to datasheet) for the HWI, it works fine...
When I look at the CIC/GPIO registers with JTAG, they seem to be configured correctly, from what I understand after reading CIC documentation.
thansk in advance