Jump to content
  • 0

Uartlite locking behaviour on "read" operation


Kris Persyn

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

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...