Pynq z1 uart

I am trying to send data to my PYNQ Z1 board via UART on the ARM CPU instead of microblaze on PYNQ with a python code, i don’t want to use microblaze because i already have an overlay to be loaded on the ZYNQ fpga,
I didn’t find any tutorials on how to do that

We need more information to be able to help you. The use case is not very clear to me. Why do you want to do this? I suppose you can just use terminal connection directly through Putty?

I want to send data to my PYNQ using PS UART0 using USB-UART where a few processing is made on the data in my Overlay, then i want to write this processed data (results) again to my PC using the same UART, I couldn’t find the commands in Jupyter notebook or Putty to do this.

I’ve achieved this by using the serial Python package. When connected to the PYNQ’s USB HOST, your device should be visible at the OS-level on the board (e.g., as /dev/ttyUSB0). Then you can write a script that initializes your UART/serial bus like so:

ser = serial.Serial(‘/dev/ttyUSB0’, baudrate=9600, timeout=0.5)

Data can then be sent & received using the methods:

ser.flushInput()
ser.write(payload)
resp = ser.read(4)

Hope that’s what you’re looking for & may be of some help.

1 Like