cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
381 Views
Registered: ‎08-08-2019

Uartlite: Receive buffer stuck in infinite loop

Hi!

I am using the basic uartlite polled mode example code

I have an RS232 PMOD connected to my Avnet ultrazed iocc.

I have connected the TX and RX of the PMOD using a jumper for a loopback test.

However, nothing is ever received. 

I'm a newbie to all this

Any insights would be helpful.

Thanks!

0 Kudos
7 Replies
Highlighted
Observer
Observer
304 Views
Registered: ‎10-01-2019

Hey there, a couple of things. First did you checkout the note for the RS232PMOD about the pin assignments:

https://reference.digilentinc.com/_media/pmod:pmod:connecting_uart_pmod_interfaces.pdf

Secondly, did you create the project using the PS or the PL UARTLite, the example code you are using is an AXI PL UART.

If you did use PS EMIO or PL UART Lite, did you verify your constraints for pins?

Its tough to debug without any kind of details about your project, but share whatever you can and we can see where it goes.

 

 

0 Kudos
Highlighted
Visitor
Visitor
232 Views
Registered: ‎08-08-2019

Hi @mleccadito !

Thank you so much for your reply!

According to 

https://www.avnet.com/opasdata/d120001/medias/docus/138/AES-ZU3EGES-1-SK-G-UltraZed-SOM-Designers-Guide-v1-1.pdf

I had connected Tx to AD5 and Rx to AE9 pins.

Please let me know if there's any more info you'll need to help me out.

Again, thank you so much.

0 Kudos
Highlighted
Observer
Observer
214 Views
Registered: ‎10-01-2019

Hey,

You shouldn't have any issue using those pins, however that doesn't exactly tell me much.

Maybe you could share some screen shots of your block design and pin constraints file, and sdk code?

Do you have a scope you could probe the TX line, or an FTDI chip that you could connect to the output of the TX? Just a debugging step to verify if its TX or RX that's the issue.

When you say your not receiving data, what exactly do you mean by that? Does it get stuck in the while loop waiting for the bytes to be received?

Just to be thorough, did you remember to export the bitstream to the SDK? It can be easy to make various changes to the hw and forget to export it before running the SDK.

I'm just throwing some ideas out there since I am not sure your level of experience, and there are a bunch of small steps that can easily be glossed over.

0 Kudos
Highlighted
Visitor
Visitor
206 Views
Registered: ‎08-08-2019

Block diagram:

shrinir_0-1597091256567.png

Constraints:

set_property PACKAGE_PIN AD5 [get_ports uart_rtl_txd]
set_property PACKAGE_PIN AE9 [get_ports uart_rtl_rxd]
set_property BITSTREAM.GENERAL.UNCONSTRAINEDPINS Allow [current_design]

And yes, it gets stuck in the while loop waiting for bytes to be received.

I don't have a way to probe it out as of now  

sdk code same as the example. just added a few print statements for easier debugging..

0 Kudos
Highlighted
Visitor
Visitor
158 Views
Registered: ‎08-08-2019

Hi @mleccadito 

Thank you for your response!

shrinir_0-1597179180356.png

I connected the Tx Rx ports to see if I am able to receive what I send. 

Again, as in the example, I send (0, 1, 2, 3, 4.... 15) through tx. I print send buffer to verify. 

But when receiving, I only get some part of the data (0, 1, 2, 3, and rest are all zeroes).

I'm wondering if it has anything to do with delays(?) I really don't know. Can you please help me out with this? Like any insights would be really helpful!

 

Thanks!

0 Kudos
Highlighted
Observer
Observer
152 Views
Registered: ‎10-01-2019

It doesn't sound like an issue, but just verify that your baudrate in the ip core matches what the default baudrate is set to in the SDK.

May I suggest trying something a little different. Try using these functions instead of the ones from the example:

void XUartLite_SendByte(UINTPTR BaseAddress, u8 Data)

u8 XUartLite_RecvByte(UINTPTR BaseAddress)

When using the functions from the example there's a bunch of auxiliary code, these two functions allow you to work with the low level driver code. You can just use two for loops, one to send the bytes and then to receive. As a reminder, these are both blocking functions.

0 Kudos
Highlighted
Visitor
Visitor
144 Views
Registered: ‎08-08-2019

Surprisingly, this worked! 

I should probably try and figure why the example code didn't work.

But I truly appreciate your help and prompt responses

Thank you so much @mleccadito for helping me learn  

0 Kudos