• 0
Kris Persyn

Uartlite locking behaviour on "read" operation

Question

Hi everybody,

I'm using Uartlite v2.0 on my Zybo z7-20 to receive data from a python script on windows. I'm capable of sending bytes in both directions. However I noticed that whenever I issue a read cmd in my Zybo (SDK), whether it happens through XUartLite_RecvByte or directly on the receive buffer, my program locks unto it untill data becomes available. Is there any way to make it non-locking?

 

Ps: I'm using Uartlite as a component in the programmable logic

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Writing blocking code to service hardware is easy to do but, as you have found out, is not usually preferred. Waiting for characters from a UART or keyboard are two examples where this might be done as a simple approach. For your project the Xilinx standalone OS SDK provides examples for two methods of handling intermittent UART events without tying up your processor in a non-productive loop;; these are polled and interrupt driven approaches.

Providing example code for hardware servicing is one area where the Xilinx SDK shines and is an excellent way to learn basic concepts.

Edited by zygot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now