UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor abhi1893
Visitor
1,612 Views
Registered: ‎02-13-2018

Unable to receive data from USB-UART interface

I am working on Zynq 702 Evaluation Board where I am trying to send and receive data using UART interface. My code works fine when I generate the bitstream from Vivado after selecting the Zynq 702 board in project settings but the same code doesn't work when I specify the corresponding part number(xc7z020clg484-1) in Vivado and then generate the bitstream. (Need to use part number as I will be using custom boards in the future)


Following is the code snippet for sending data:

 

for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
/* Wait until there is space in TX FIFO */
while (XUartPs_IsTransmitFull(UartBaseAddress));

/* Write the byte into the TX FIFO */
XUartPs_WriteReg(UartBaseAddress, XUARTPS_FIFO_OFFSET,
SendBuffer[Index]);
}

The above code works perfectly fine for both with Zynq Board and when using part number.

However I am unable to receive data from UART using following code. This works perfectly when specifying Zynq Board instead of part number in Vivado:

 

Running = TRUE;
while (Running) {
/* Wait until there is data */
while (!XUartPs_IsReceiveData(UartBaseAddress)); 
while(recvCount<4)
{
input.bytes_array[recvCount]=XUartPs_RecvByte(UartBaseAddress);
recvCount++;
}
}

The above code is unable to hit the `while(recvCount<4)` code (on debugging) after sending data through UART terminal(when using part number in Vivado). What could be the problem here? Everything in Vivado block design is the same except the specification of board in one case and part number in the other.

Tags (5)
0 Kudos
4 Replies
Moderator
Moderator
1,558 Views
Registered: ‎11-09-2015

Re: Unable to receive data from USB-UART interface

Hi @abhi1893,

 

Did you use the same vivado project and just changed the part? It should work...

 

I would start by checking the UART configuration in the Zynq IP. Make sure it is mapped to the correct MIO.

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Visitor abhi1893
Visitor
1,539 Views
Registered: ‎02-13-2018

Re: Unable to receive data from USB-UART interface

Yes It does work when I change the part in the same project but when I design it from scratch using the part, the transmission happens but not the reception from UART.

 

I am using UART1 and MIO 48-49 in Zynq PS.

0 Kudos
Xilinx Employee
Xilinx Employee
1,530 Views
Registered: ‎02-26-2014

Re: Unable to receive data from USB-UART interface

Hi,

 

The main difference I see between working and non-working projects is the PS configuration. When you select the board, the PS is configured for the board, which will not happen when you choose a part. To confirm this you can try following:

 

1.  Use the FSBL of working project, and rest all from your custom board project. If the UART MIOs for UART are different in your custom board, this may not work.

2. Alternatively, you can try saving PS configuration from PCW of zc702 working project and source it in PCW of custom board project. And then make the changes for your custom board (MIOs and others).

 

If the above do not work, then the issue may not be the FSBL, and you may have to look at the MIO configuration. If the prints on the serial terminal are fine for non-working project, UART transmit is fine and the UART connections are good.

 

Regards,

Ravi

0 Kudos
Newbie praneetcs
Newbie
245 Views
Registered: ‎11-06-2019

Re: Unable to receive data from USB-UART interface

I have the same issue - the code does not hit the while(recvCount<4) loop.

Did anybody reslove this problem. If yes, how ?

0 Kudos