cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
komura.koji
Visitor
Visitor
10,618 Views
Registered: ‎02-17-2015

Doesn't work UartLite with interupt

Jump to solution

Hi

 

I'm programming with Microblaze(Spartan6).

I compiled correctly,but seem to not working.

When input a serial data,not call interrupt handler.

 

Attachment file is my source code.Is something wrong?

 

I use uartlite_v2_01_a and intc_v2_06_a libraly.

 

follow is xparameters.h

/* Canonical definitions for peripheral RS232_2 */
#define XPAR_UARTLITE_2_DEVICE_ID XPAR_RS232_2_DEVICE_ID
#define XPAR_UARTLITE_2_BASEADDR 0x40600000
#define XPAR_UARTLITE_2_HIGHADDR 0x4060FFFF
#define XPAR_UARTLITE_2_BAUDRATE 115200
#define XPAR_UARTLITE_2_USE_PARITY 0
#define XPAR_UARTLITE_2_ODD_PARITY 0
#define XPAR_UARTLITE_2_DATA_BITS 8
#define XPAR_UARTLITE_2_SIO_CHAN 1

/* Canonical definitions for peripheral AXI_INTC_0 */
#define XPAR_INTC_0_DEVICE_ID XPAR_AXI_INTC_0_DEVICE_ID
#define XPAR_INTC_0_BASEADDR 0x41200000
#define XPAR_INTC_0_HIGHADDR 0x4120FFFF
#define XPAR_INTC_0_KIND_OF_INTR 0xFFFFFFF9
#define XPAR_INTC_0_HAS_FAST 0
#define XPAR_INTC_0_IVAR_RESET_VALUE 0x00000010
#define XPAR_INTC_0_NUM_INTR_INPUTS 3
#define XPAR_INTC_0_INTC_TYPE 0
#define XPAR_INTC_0_UARTLITE_2_VEC_ID XPAR_AXI_INTC_0_RS232_2_INTERRUPT_INTR
#define XPAR_INTC_0_IIC_0_VEC_ID XPAR_AXI_INTC_0_AXI_IIC_0_IIC2INTC_IRPT_INTR
#define XPAR_INTC_0_TMRCTR_0_VEC_ID XPAR_AXI_INTC_0_AXI_TIMER_0_INTERRUPT_INTR

 Please help me!

 

 Thanks.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
komura.koji
Visitor
Visitor
17,907 Views
Registered: ‎02-17-2015

Finally, I found a solution.

Xilinx staff saying,this is a bug of System Debugger(Xilinx SDK).

I used a System Debugger.But I change to GDB,it works good.

View solution in original post

0 Kudos
5 Replies
10,596 Views
Registered: ‎05-22-2012

Try this:

int UartLiteSetupIntrSystem(XIntc *IntcInstancePtr,
				XUartLite *UartLiteInstPtr,
				u16 UartLiteIntrId)
{
	int Status;

	/*
	 * 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 = XIntc_Connect(IntcInstancePtr, UartLiteIntrId,
			(XInterruptHandler)XUartLite_InterruptHandler,
			(void *)UartLiteInstPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

/*
	 * Enable the interrupt for the UartLite.
	 */
	XIntc_Enable(IntcInstancePtr, UartLiteIntrId);

	XUartLite_EnableInterrupt(UartLiteInstPtr);

	return XST_SUCCESS;
}

int IntcInterruptSetup(XIntc *IntcInstancePtr, u16 DeviceId)
{

	int Status;

	/*
	 * Initialize the interrupt controller driver so that it is
	 * ready to use.
	 */
	Status = XIntc_Initialize(IntcInstancePtr, DeviceId);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Perform a self-test to ensure that the hardware was built  correctly.
	 */

	/*
	 * Initialize the exception table.
	 */
	Xil_ExceptionInit();

	/*
	 * Register the interrupt controller handler with the exception table.
	 */
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
			(Xil_ExceptionHandler)XIntc_DeviceInterruptHandler,
			(void*) 0);

	/*
	 * Enable exceptions.
	 */
	Xil_ExceptionEnable();

	/*
	 * Start the interrupt controller such that interrupts are enabled for
	 * all devices that cause interrupts.
	 */
	Status = XIntc_Start(IntcInstancePtr, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;

}


main( )
{ if ( IntcInterruptSetup(&InterruptController, XPAR_INTC_0_DEVICE_ID)!= XST_SUCCESS ) return XST_FAILURE; if ( XUartLite_Initialize( &uartData, XPAR_UART_DATA_DEVICE_ID) != XST_SUCCESS ) return XST_FAILURE;

    if ( UartLiteSetupIntrSystem(&InterruptController,&uartData, XPAR_UART_DATA_INTERRUPT_INTR )!= XST_SUCCESS )
        return XST_FAILURE;
}

 

0 Kudos
komura.koji
Visitor
Visitor
10,582 Views
Registered: ‎02-17-2015

Thank you for your replying.

 

But, now my device doesn't work.Sended serial data is received UartLite IP.

So I can receive all data with polling procedure.But with Interrupt doesn't.

 

 

 

My way for confirmation is that set a breakpoint to a function XIntc_DeviceInterruptHandler().

But doesn't break to this point...

 

0 Kudos
htsvn
Xilinx Employee
Xilinx Employee
10,562 Views
Registered: ‎08-02-2007

hi,

 

can you attach the code that you are trying?

 

--hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
komura.koji
Visitor
Visitor
10,522 Views
Registered: ‎02-17-2015

Thanks,replying.

 

I have attached my code...

 

Please refer all this post.

 

Thanks.

0 Kudos
komura.koji
Visitor
Visitor
17,908 Views
Registered: ‎02-17-2015

Finally, I found a solution.

Xilinx staff saying,this is a bug of System Debugger(Xilinx SDK).

I used a System Debugger.But I change to GDB,it works good.

View solution in original post

0 Kudos