Hi,
I'm quite new to Application Development for Zynq Chips.
I successfully implemented a PL->PS interrupt in a baremetal environment using the tutorials. Now I thought porting it to FreeRTOS would be straight forward but once the task scheduler runs I can't get any interrupt fired.
I'm sure I'll just have to link my ISR to some FreeRTOS Task/function but can't find any hints on how to do so. I would really appreciate it if someone could point me in the right direction.
Edit: I'm using an AXI GPIO Core connected to the push buttons with F2PIRQ. The GPIO is initialized using the XGpio_* functions.
My initializing code is the following (called from main, as any call from a task will crash the system):
int SetupInterruptSystem()
{
int Result;
INTC *IntcInstancePtr = &Intc;
XScuGic_Config *IntcConfig;
/*
* Initialize the interrupt controller driver so that it is ready to
* use.
*/
IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
if (NULL == IntcConfig) {
return XST_FAILURE;
}
Result = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
IntcConfig->CpuBaseAddress);
if (Result != XST_SUCCESS) {
return XST_FAILURE;
}
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
(Xil_ExceptionHandler)INTC_HANDLER, IntcInstancePtr);
/* Enable non-critical exceptions */
Xil_ExceptionEnable();
/*
* Connect the interrupt handler that will be called when an
* interrupt occurs for the device.
*/
Result = XScuGic_Connect(IntcInstancePtr, XPAR_FABRIC_AXI_BTN_IN_IP2INTC_IRPT_INTR,
(Xil_ExceptionHandler)GpioIsr, (void *) &Gpio);
if (Result != XST_SUCCESS) {
return Result;
}
XGpio_InterruptEnable(&Gpio, 1);
XGpio_InterruptGlobalEnable(&Gpio);
XScuGic_Enable(IntcInstancePtr, XPAR_FABRIC_AXI_BTN_IN_IP2INTC_IRPT_INTR);
/*
* Initialize the exception table and register the interrupt
* controller handler with the exception table
*/
//Xil_ExceptionInit();
return XST_SUCCESS;
}