cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dbircsak
Observer
Observer
2,032 Views
Registered: ‎06-13-2016

XScuGic with more than one device?

Jump to solution

If I have an XIicPs at XPAR_XIICPS_0_DEVICE_ID and another XIicPs at XPAR_XIICPS_1_DEVICE_ID
and I configure both to use XPAR_SCUGIC_SINGLE_DEVICE_ID should I make two instances of a XScuGic, or can I use one XScuGic and then call XScuGic_Connect on each XIicPs?

 

Also, when initializing the XScuGic for the XIicPs's I call:

 

XScuGic_LookupConfig
XScuGic_CfgInitialize
XScuGic_SelfTest
XScuGic_Connect
XScuGic_Enable
Xil_ExceptionInit
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT, (Xil_ExceptionHandler) XScuGic_InterruptHandler, &scuGic);
Xil_ExceptionEnable();

But then I am also using LWIP with UDP and am calling:

 

Xil_ExceptionInit();
XScuGic_DeviceInitialize(XPAR_SCUGIC_SINGLE_DEVICE_ID);
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT,
		(Xil_ExceptionHandler) XScuGic_DeviceInterruptHandler,
		XPAR_SCUGIC_SINGLE_DEVICE_ID);
XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, XPAR_SCUTIMER_INTR);
Xil_ExceptionEnable();

Why does IIC not call XScuGic_DeviceInitialize like LWIP does?

 

Does having Xil_ExceptionRegisterHandler on XScuGic_InterruptHandler *and* on XScuGic_DeviceInterruptHandler for the same ID (XPAR_SCUGIC_SINGLE_DEVICE_ID) between the two XIicPs's and LWIP cause issues?

 

How can I implement this cleanly? I cannot find an example of ScuGic being used for multiple things!

 

Thanks

0 Kudos
1 Solution

Accepted Solutions
dbircsak
Observer
Observer
2,395 Views
Registered: ‎06-13-2016

I was able to get it all working by not running XScuGic_DeviceInitialize as this will reset the interrupts!

 

For UDP:

//	Xil_ExceptionInit();

//	XScuGic_DeviceInitialize(XPAR_SCUGIC_SINGLE_DEVICE_ID);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT,
			(Xil_ExceptionHandler) XScuGic_DeviceInterruptHandler,
			XPAR_SCUGIC_SINGLE_DEVICE_ID);

	XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, XPAR_SCUTIMER_INTR);
//	Xil_ExceptionEnable();

View solution in original post

3 Replies
dbircsak
Observer
Observer
2,396 Views
Registered: ‎06-13-2016

I was able to get it all working by not running XScuGic_DeviceInitialize as this will reset the interrupts!

 

For UDP:

//	Xil_ExceptionInit();

//	XScuGic_DeviceInitialize(XPAR_SCUGIC_SINGLE_DEVICE_ID);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT,
			(Xil_ExceptionHandler) XScuGic_DeviceInterruptHandler,
			XPAR_SCUGIC_SINGLE_DEVICE_ID);

	XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, XPAR_SCUTIMER_INTR);
//	Xil_ExceptionEnable();

View solution in original post

michelcharette
Observer
Observer
528 Views
Registered: ‎06-07-2012

Thanks for taking the time to post the solution to your own problem!

0 Kudos
derekm_
Voyager
Voyager
516 Views
Registered: ‎01-16-2019

To avoid other forum users getting confused, I think it should be pointed out that the solution in this post is wrong. (Just because something works, doesn't make it the right approach.) Only one GIC is needed in the system, it should only be configured once, and likewise the function Xil_ExceptionRegisterHandler(... XScuGic_DeviceInterruptHandler.. ) should only be called once. The solution indicates that it is okay to call it twice. (Calling it twice won't have a detrimental effect in the system, but it doesn't need to be done.)

 

 

0 Kudos