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.

TDA3 GPIO ISR Implementation question

Other Parts Discussed in Thread: SYSBIOS

Hi Support, 

I am using the Processor Vision SDK on D3 TDA3 RVP and would like to route a vsync signal through the processor and output it on one of the isolated output GPIO.  The vsync is on GPIO2_9 measured successfully on an oscilliscope and output of the vsync needs to be on GPIO2_4 which i can toggle in code successfully via gpio writes.  When I configure GPIO2_9 as an interrupt on IPU1, the use case hangs.  Below are the major code blocks, any insight would be greatly appreciated.

 UInt32 VSYNC_Base = SOC_GPIO2_BASE;
UInt32 VSYNC_Out_Pin = 4U;
UInt32 VSYNC_In_Pin = 9U;
uint16_t vsync_interrupt_num = 52;

#define IRQ_XBAR_CFG_REQUIRED 1
#define IRQ_XBAR_CPU_ID CSL_XBAR_IRQ_CPU_ID_IPU1
#define IRQ_XBAR_INST_NO CSL_XBAR_INST_IPU1_IRQ_52
#define IRQ_XBAR_INDEX CSL_XBAR_GPIO2_IRQ_1

void chains_4chIssIspSimcop_vsyncIsr(void *arg)
{
volatile uint32_t gpio_pin_value = 0;
/*Disable interrupt*/
GPIOPinIntDisable(VSYNC_Base, GPIO_INT_LINE_1, VSYNC_In_Pin);

/*Read In pin*/
gpio_pin_value = GPIOPinRead(VSYNC_Base, VSYNC_In_Pin);

/*Write Out pin*/
GPIOPinWrite(VSYNC_Base, VSYNC_Out_Pin, gpio_pin_value);

GPIOPinIntClear(VSYNC_Base, GPIO_INT_LINE_1, VSYNC_In_Pin);

/*Enable interrupt interrupt*/
GPIOPinIntEnable(VSYNC_Base, GPIO_INT_LINE_1, VSYNC_In_Pin);

}

void configurGpioInterrupt()
{
#if IRQ_XBAR_CFG_REQUIRED
/* XBar configuration */
CSL_xbarIrqConfigure(IRQ_XBAR_CPU_ID,IRQ_XBAR_INST_NO,IRQ_XBAR_INDEX);
#endif
Intc_Init();
Intc_IntEnable(vsync_interrupt_num);

Intc_IntRegister(vsync_interrupt_num, (IntrFuncPtr) chains_4chIssIspSimcop_vsyncIsr, (void *) 0);
Intc_IntPrioritySet(vsync_interrupt_num, 1, 0);
Intc_SystemEnable(vsync_interrupt_num);
}


// main usecase code below

/*Configure interrupt controller*/
Vps_printf("Configure VSYNC Interrupt\n");
configurGpioInterrupt();

GPIOIntTypeSet(VSYNC_Base, VSYNC_In_Pin, GPIO_INT_TYPE_FALL_EDGE);

Vps_printf("Set IO Directions\n");
/* Set pin direction as input*/
GPIODirModeSet(VSYNC_Base, VSYNC_In_Pin, GPIO_DIR_INPUT);
GPIODirModeSet(VSYNC_Base, VSYNC_Out_Pin, GPIO_DIR_OUTPUT);

/*Clear interrupt*/
Vps_printf("Clear VSYNC Interrupt\n");
GPIOPinIntDisable(VSYNC_Base, GPIO_INT_LINE_1, VSYNC_In_Pin);
GPIOPinIntClear(VSYNC_Base, GPIO_INT_LINE_1, VSYNC_In_Pin);

/*Enable interrupt*/
Vps_printf("Enable VSYNC Interrupt\n");
GPIOPinIntEnable(VSYNC_Base, GPIO_INT_LINE_1, VSYNC_In_Pin);

Thank You,

George Vigelette