cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Advisor
Advisor
1,817 Views
Registered: ‎10-10-2014

running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

Using Zynq with Vivado 2015.4 with this basic bd :

 

uart lite irq ps.jpg

 

I put an external loopback on the uart tx/rx lines, running the uartlite polled example works fine, so hardware is ok.

 

up next was trying to run  'xuartlite_intr_example' , however after importing these examples, SDK complained about a missing 'intc', which is the driver of an AXI Interrupt controller. 

 

So I tried to add this 'intc' controller as follows :

 

axi uart lite irq.jpg

 

I could not directly connect the 'interrupt' interface of the AXI interrupt controller to IRQ_F2P of the PS, so I connected the 'irq' output directly. 

 

After updating the bitstream and sending the new .hdf to SDK, the example no longer complained about a missing 'intc'

 

Now when running the example, I can see the tx/rx data appear on the external loopback wire with a scope, however I get no rx nor tx interrupts (I put a breakpoint in both). Also the example is waiting for the data if I break the PS :

 

	/*
	 * Wait for the entire buffer to be received, letting the interrupt
	 * processing work in the background, this function may get locked
	 * up in this loop if the interrupts are not working correctly.
	 */
	while ((TotalReceivedCount != TEST_BUFFER_SIZE) ||
		(TotalSentCount != TEST_BUFFER_SIZE)) {
	}

  

 

The example doesn't seem to initialize the Zynq GIC at all. Then I found this thread, so looks like this example code using an intc is a microblaze only example? 

 

So if i want to use axi_uartlite on Zynq, I should probably connect the uartlite irq output directly (or through a concat) with the IRQ_F2P input of the PS, without using 'intc' ? Is there an example for this?

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
8 Replies
Highlighted
Advisor
Advisor
1,778 Views
Registered: ‎10-10-2014

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

ok - think I found the answer ... I should have tried 'xuartlite_intr_tapp_example.c' instead, looks like this one has been updated for use with Zynq : 

 

* 2.01a ssb 01/11/01 Updated the example to be used with the SCUGIC in Zynq.

 

It would have been great if the readme.txt file contained some short guidance on both projects, that xuartlite_intr_example.c is for use only with microblaze / intc controller. The 2nd example seems to autodectect if there is an INTC present or not ... 

 

so I took back the first bd (without the AXI interrupt controller)

 

but now, when trying to build I get this error :

 

uart example.jpg

 

"XPAR_INTC_0_UARTLITE_0_VEC_ID" is undeclared.

 

checking xparametrs.h showed me I needed to change this into : 

 

#ifndef TESTAPP_GEN
#define UARTLITE_DEVICE_ID	  XPAR_UARTLITE_0_DEVICE_ID
#define UARTLITE_IRPT_INTR	  XPAR_FABRIC_AXI_UARTLITE_0_INTERRUPT_INTR  // XPAR_INTC_0_UARTLITE_0_VEC_ID

#ifdef XPAR_INTC_0_DEVICE_ID
#define INTC_DEVICE_ID		XPAR_INTC_0_DEVICE_ID
#else
#define INTC_DEVICE_ID		XPAR_SCUGIC_SINGLE_DEVICE_ID
#endif /* XPAR_INTC_0_DEVICE_ID */
#endif /* TESTAPP_GEN */

after this modification, the example worked correctly. However, the example is less complete than 'xuartlite_intr_example', it does not verify the loopbacked data.

 

1 question remains : is there any practical use of the AXI interrupt controller in Zynq?

 

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
Highlighted
Adventurer
Adventurer
1,524 Views
Registered: ‎05-29-2018

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

 there is no need to use the AXI interrupt controller in Zynq sice there is a GIC in the PS of ZYNQ.  the GIC work as the "interrupt controller". The example is used in the application that not zynq such as SP6 serise. 

0 Kudos
Highlighted
1,270 Views
Registered: ‎04-15-2019

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

Hello, I am also trying this example, but there have been some errors, can you add a contact to facilitate communication?Here are some of the errors I made.(My QQ:2273667502)

/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:182:对‘xil_printf’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:186:对‘xil_printf’未定义的引用
./src/helloworld.o:在函数‘UartLiteIntrExample’中:
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:233:对‘XUartLite_Initialize’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:241:对‘XUartLite_SelfTest’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:263:对‘XUartLite_SetSendHandler’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:265:对‘XUartLite_SetRecvHandler’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:272:对‘XUartLite_EnableInterrupt’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:284:对‘XUartLite_Send’未定义的引用
./src/helloworld.o:在函数‘UartLiteSetupIntrSystem’中:
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:429:对‘XScuGic_LookupConfig’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:434:对‘XScuGic_CfgInitialize’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:441:对‘XScuGic_SetPriorityTriggerType’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:448:对‘XUartLite_InterruptHandler’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:448:对‘XUartLite_InterruptHandler’未定义的引用
makefile:36: recipe for target 'uart_test.elf' failed
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:448:对‘XScuGic_Connect’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:458:对‘XScuGic_Enable’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:468:对‘Xil_ExceptionInit’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:473:对‘XScuGic_InterruptHandler’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:473:对‘XScuGic_InterruptHandler’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:473:对‘Xil_ExceptionRegisterHandler’未定义的引用
./src/helloworld.o:在函数‘UartLiteDisableIntrSystem’中:
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:512:对‘XScuGic_Disable’未定义的引用
/home/lyy/work/linux_app/uart_test/Debug/../src/helloworld.c:513:对‘XScuGic_Disconnect’未定义的引用
collect2: error: ld returned 1 exit status
make: *** [uart_test.elf] Error 1

0 Kudos
Highlighted
Moderator
Moderator
1,260 Views
Registered: ‎07-31-2012

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

Hi @zengzxxilinx ,

Your query is not relevant to the previous posts.

Please create a new post and send it through this board.

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
1,240 Views
Registered: ‎04-15-2019

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

Hello, can you answer my question?

0 Kudos
Highlighted
Advisor
Advisor
1,229 Views
Registered: ‎10-10-2014

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

@chaorenbuhuifei I'm afraid I cannot help you, your post is partially in chinese, which is ... chinese for me :-) Sorry for that. Also your question seems to be Linux related (?), my post was about a bare metal application. I think your best bet is to create a new post

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Highlighted
1,227 Views
Registered: ‎04-15-2019

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

Yes, my application is on Linux. I have found several examples on the wiki, such as: xuartlite_intr_example.c/xuartlite_intr_tpp_example.c/xuartlite_low_level_example.c/. Are these examples for bare metal? Isn't it an application that can be used for Linux?

0 Kudos
Highlighted
Advisor
Advisor
1,197 Views
Registered: ‎10-10-2014

Re: running the AXI UART Lite irq examples on Zynq (AXI intc vs PS gic)

these examples are indeed for bare metal. In linux code you'll see header files of the linux system included. 

your example is located here: 

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/uartlite/examples/xuartlite_intr_example.c

if you move up to 'embeddedsw', you'll see :

https://github.com/Xilinx/embeddedsw

the readme.txt says 'embeddedsw.git - repo for standalone software'

I'm not a linux programmer, so I don't know where you should start for a UART example on linux. I think it's best you search the forum for 'linux' and 'uart', if you find an answer/link, please post it here so people can jump to that link too.

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos