Hello,
I'm trying to use interrupt from a my custom IP.
I have create signal (signal_IRQ) on the customize IP of the Zynq.
This signal on my Block Design, I connect to GPIO_IO_I port (axi_gpio) and IP2INTC_Irpt to IRQ_F2P.
I tried on another: create interrupt signal (rising edge, 1 bit, priority = medium) in my custom IP and connect signal to IRQ_F2P (without using axi_gpio).
in my IP, interrupt generated every 3 sec.
------------------------------------------------------
In both cases I see the same error.
The first interrupt works OK, but the second doesn't work and gives out a error:
In Debug, my code stop in file port_asm_vectors.s DataAbortHandler (82 line).
How i can correct this problem?
//-----------------------------------------------//
I do C-code in SDK (Release Version: Release 14.4 Build SDK_P.49d) as in examples. my code path:
#define CNT_INTERRUPTtt1
#define CNT_DEVICE_IDtXPAR_AXI_GPIO_0_DEVICE_ID
/***INTERRUPT***/
#define GIC_INTCt XScuGic
#define GIC_INTC_HANDLER XScuGic_InterruptHandler
#define GIC_INTC_DEVICE_ID XPAR_PS7_SCUGIC_0_DEVICE_ID
#define CNT_INTERRUPT_ID XPAR_FABRIC_GPIO_0_VEC_ID
static tGIC_INTC tIntc;
XGpio tttGpioCnt;
Status += XGpio_Initialize(&GpioCnt, CNT_DEVICE_ID);
Status += SetupInterruptSystemGIC();
enable_interrupts();
void Cnt_Isr(void *InstancePtr)
{
tu32 Reg = 0;
t
tXGpio *GpioPtr = (XGpio *)InstancePtr;
tXGpio_InterruptDisablet (GpioPtr, CNT_INTERRUPT);
tinterrupt_flag = 1;
t
tReg = XGpio_ReadReg(GpioPtr->BaseAddress, XGPIO_ISR_OFFSET);
tXGpio_WriteReg(GpioPtr->BaseAddress, XGPIO_ISR_OFFSET, Reg&CNT_INTERRUPT);
t
tXGpio_InterruptEnable (GpioPtr, CNT_INTERRUPT);
}
int SetupInterruptSystemGIC()
{
tint Result;
tGIC_INTC *IntcInstancePtr = &Intc;
tXScuGic_Config *IntcConfig;
tIntcConfig = XScuGic_LookupConfig(GIC_INTC_DEVICE_ID);
tif (NULL == IntcConfig) {
ttreturn XST_FAILURE;
t}
tResult = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
tttttIntcConfig->CpuBaseAddress);
tif (Result != XST_SUCCESS) {
ttreturn XST_FAILURE;
t}
tXScuGic_SetPriorityTriggerType(IntcInstancePtr, CNT_INTERRUPT_ID, t 0xA0, 0x3);t// always
t// Connect the interrupt handle
tResult += XScuGic_Connect(IntcInstancePtr, CNT_INTERRUPT_ID, (Xil_ExceptionHandler)Cnt_Isr,t&GpioCnt);
tif (Result != XST_SUCCESS) {
ttreturn XST_FAILURE;
t}
t//Enable the interrupt for the GPIO, TIMER device.
tXScuGic_Enable(IntcInstancePtr, CNT_INTERRUPT_ID);
t// Enable the GPIO channel interrupts so that push switch
tXGpio_InterruptEnable(&GpioCnt, CNT_INTERRUPT);
tXGpio_InterruptGlobalEnable(&GpioCnt);
t// Initialize the exception table and register the interrupt
tXil_ExceptionInit();
tXil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT, (Xil_ExceptionHandler)GIC_INTC_HANDLER, IntcInstancePtr);
t
treturn XST_SUCCESS;
}
void enable_interrupts()
{
tXil_ExceptionEnable();
treturn;
}
void disable_interrupts()
{
tXil_ExceptionDisable();
treturn;
}