cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dkartis2
Observer
Observer
8,308 Views
Registered: ‎11-07-2013

Enable Uartlite Interrupts on xilkernel

I've checked the other solutions on the forum for this topic, but have yet to find a solution. I was using a standalone bsp, but created a xilkernel bsp since I need multithreading. After switching, I can send data from the board but can't receive, the receive handler is never called.

 

I saw that the initialization process is different for xilkernel. My hardware design consists of a concatenator, interrupt controller, uartlite, and microblaze, in addition to other IPs.

 

Following the xilkernel documentation, I created the following. Is it correct? Also, is the process the same for all interrupts?

 

// Initialize UARTLITE
status = XUartLite_Initialize (&uartLiteRecvInst, XPAR_RS232_DTE_DEVICE_ID);
if (status != XST_SUCCESS)
{
return -1; //XST_FAILURE;
}

// Register and enable interrupt handler for UartLite RS232_DTE
ret = register_int_handler(XPAR_XPS_INTC_0_RS232_DTE_INTERRUPT_INTR,
XUartLite_InterruptHandler, (void *)&uartLiteRecvInst);
// Registering the receive Xuartlite interrupt handler
XuartLite_SetRecvHandler(&uartLiteRecvInst, Recv_Handler,
&uartLiteRecvInst);
// Enabling interrupt in the XILKERNEL
enable_interrupt(XPAR_XPS_INTC_0_RS232_DTE_INTERRUPT_INTR);
// Enabling interrupt in the Xuartlite hardware i.e. RS232_DTE
XuartLite_EnableInterrupt(&uartLiteRecvInst);

 

I used the following for the working standalone implementation:

int UartLiteIntrExample(u16 DeviceId)
{
	int Status;
	int Index;

	Status = XUartLite_Initialize(&UartLite, DeviceId);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

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

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

	XUartLite_SetSendHandler(&UartLite, SendHandler, &UartLite);
	XUartLite_SetRecvHandler(&UartLite, RecvHandler, &UartLite);

	XUartLite_EnableInterrupt(&UartLite);

	return XST_SUCCESS;
}

int SetupInterruptSystem(XUartLite *UartLitePtr)
{
	int Status;

	Status = XIntc_Initialize(&InterruptController, INTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	Status = XIntc_Connect(&InterruptController, UARTLITE_INT_IRQ_ID,
			   (XInterruptHandler)XUartLite_InterruptHandler,
			   (void *)UartLitePtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	Status = XIntc_Start(&InterruptController, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	XIntc_Enable(&InterruptController, UARTLITE_INT_IRQ_ID);

	Xil_ExceptionInit();

	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
			 (Xil_ExceptionHandler)XIntc_InterruptHandler,
			 &InterruptController);

	Xil_ExceptionEnable();

	return XST_SUCCESS;
}

 

 

My xilkernel version is 6.1 and I'm using SDK 2014.2.

0 Kudos
3 Replies
balkris
Xilinx Employee
Xilinx Employee
8,293 Views
Registered: ‎08-01-2008

check this document

https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CBwQFjAAahUKEwigmoXkl5LIAhVQVY4KHSuRBsU&url=https%3A%2F%2Fwiki.nus.edu.sg%2Fdownload%2Fattachments%2F83231420%2Finterrrupts.pdf&usg=AFQjCNHIFcX4YB8fSu469VFUeBFVKWWa9w&sig2=RbgsXun...
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
dkartis2
Observer
Observer
8,287 Views
Registered: ‎11-07-2013

Thank you, but that's the same code that I used and it did not work. In my pthread, the following statement was called an implicit function:

 

XuartLite_EnableInterrupt(&uartLiteRecvInst);

 

Even though, this statement wasn't declared implicit in a function on my main thread. How can that be?

0 Kudos
pvenugo
Moderator
Moderator
8,278 Views
Registered: ‎07-31-2012

Hi,

 

Refer to https://forums.xilinx.com/t5/Embedded-Development-Tools/interrupt-test-fail-with-xilkernel/m-p/651145#M37718 for support of Xilkernel.

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos