Issues interfacing RTC with PYNQ-Z2 using SMBus / I2C (considering Arduino as intermediary)

PYNQ Image v2.x (standard precompiled image)

Board

PYNQ-Z2 (Zynq-7020)

Image Type

Standard PYNQ image (not custom-built)


Problem Description

I am trying to interface an external RTC module with a PYNQ-Z2 board using I2C from Python. My goal is to read time data from the RTC within a PYNQ notebook.

I attempted to use the smbus / smbus2 Python library for I2C communication, but I am facing issues installing or using SMBus on the PYNQ Linux environment. Because of these issues, I am also exploring an alternative architecture where the RTC is connected to an Arduino, and the Arduino communicates with the PYNQ-Z2 (via UART/I2C/SPI).

I am unsure whether this approach is recommended or if there is a better native way to handle RTCs on PYNQ.


Error / Issue Details

  • smbus is not available by default on PYNQ
  • Installing smbus / smbus2 via pip leads to dependency or runtime issues
  • I2C access from Python is not working as expected

(Exact error messages can be provided if required.)


Steps to Reproduce

  1. Boot PYNQ-Z2 with standard PYNQ image
  2. Attempt to install smbus / smbus2 using pip
  3. Try to access I2C bus from Python to communicate with RTC
  4. Encounter installation or runtime errors

What I Have Tried

  • Installing smbus and smbus2 via pip
  • Checking I2C device availability using Linux tools
  • Considering Arduino-to-PYNQ communication as a workaround

Questions

  1. Is using smbus / smbus2 the recommended way to access I2C devices on PYNQ?
  2. Is connecting an RTC to Arduino and then interfacing Arduino with PYNQ a valid or recommended design?
  3. Are there PYNQ-specific libraries or overlays better suited for RTC or I2C peripherals?