cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
914 Views
Registered: ‎12-17-2016

IRQ_F2P edge interrupt for FIT Timer on XPS_FPGA1_INT_ID works for z7010 but not with z7035

Jump to solution

Dear All,

 

I wanted to test simple FIT Timer interrupt with zynq. I created the following BD.

 

Fit_BD.png

This similar BD is made for both z7010 & z7035

 

This interrupt code is as follows along with handler

 

#define INTC_DEVICE_ID			XPAR_SCUGIC_0_DEVICE_ID
#define INTC_DEVICE_INT_ID		XPS_FPGA1_INT_ID
volatile static int InterruptProcessed = FALSE;


int SetUpInterruptSystem(XScuGic *XScuGicInstancePtr);
void DeviceDriverHandler(void *CallbackRef);
void DeviceDriverHandler_2(void *CallbackRef);

int ScuInit(void);

int main()
{
    init_platform();
    ScuInit();
    print("Hello World\n\r");
    while(1);
    cleanup_platform();
    return 0;
}

int ScuInit(void) {
	int Status;

	/*
	 * Initialize the interrupt controller driver so that it is ready to
	 * use.
	 */
	GicConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
	if (NULL == GicConfig) {
		return XST_FAILURE;
	}

	Status = XScuGic_CfgInitialize(&InterruptController, GicConfig,
					GicConfig->CpuBaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Setup the Interrupt System
	 */
	Status = SetUpInterruptSystem(&InterruptController);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	XScuGic_SetPriorityTriggerType(&InterruptController, INTC_DEVICE_INT_ID,32, 1); // 1 for high level interrupt and 3 for edge interrupt
	/*
	 * Connect a device driver handler that will be called when an
	 * interrupt for the device occurs, the device driver handler performs
	 * the specific interrupt processing for the device
	 */
	Status = XScuGic_Connect(&InterruptController, INTC_DEVICE_INT_ID,
			   (Xil_ExceptionHandler)DeviceDriverHandler,
			   (void *)&InterruptController);

	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Enable the interrupt for the device and then cause (simulate) an
	 * interrupt so the handlers will be called
	 */
	XScuGic_Enable(&InterruptController, INTC_DEVICE_INT_ID);
	/*
	 * Enable interrupts in the ARM
	 */
	Xil_ExceptionEnable();

	return XST_SUCCESS;
}

int SetUpInterruptSystem(XScuGic *XScuGicInstancePtr)
{

	/*
	 * Connect the interrupt controller interrupt handler to the hardware
	 * interrupt handling logic in the ARM processor.
	 */
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
			(Xil_ExceptionHandler) XScuGic_InterruptHandler,
			XScuGicInstancePtr);


	return XST_SUCCESS;
}

void DeviceDriverHandler(void *CallbackRef)				//FIT
{
	/*
	 * Indicate the interrupt has been processed using a shared variable
	 */
	InterruptProcessed = TRUE;
	xil_printf("a ");
}

In z7010 Zybo Board interrupt works fine but with z7035 picozed board it doesnt interrupt at all.

I dont understand why it works in one board and not in other.

 

Please any one help me with some indicators.

 

Regards

Kashyap

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
830 Views
Registered: ‎12-17-2016

Finally I figured out how Interrupt IDs are given to IPs included in BD Design.

 

FIT Timer gets an interrupt id unique to the Zynq Chip that is used. This can be found out in xparameters.h file.

 

For z7010 its same as XPS_FPGA_INT_ID i.e. 61 but on z7035 the FIT Timer is given 91. I corrected the Interrupt ID and it worked fine.

 

I would like some one to explain in more details how interrupts connected to IRQ_F2P assigned interrup ids in different Zynq Chips.

 

Thanks

View solution in original post

0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
871 Views
Registered: ‎09-01-2014
Do you see irq_f2p interrupt signal toggled in from ILA in Z7035 board?
0 Kudos
Highlighted
Observer
Observer
831 Views
Registered: ‎12-17-2016

Yes

0 Kudos
Highlighted
Observer
Observer
831 Views
Registered: ‎12-17-2016

Finally I figured out how Interrupt IDs are given to IPs included in BD Design.

 

FIT Timer gets an interrupt id unique to the Zynq Chip that is used. This can be found out in xparameters.h file.

 

For z7010 its same as XPS_FPGA_INT_ID i.e. 61 but on z7035 the FIT Timer is given 91. I corrected the Interrupt ID and it worked fine.

 

I would like some one to explain in more details how interrupts connected to IRQ_F2P assigned interrup ids in different Zynq Chips.

 

Thanks

View solution in original post

0 Kudos