ZCU208 xrfclk error: spi not set. lmx/lmk not found. issue bsp

Hi guys,

I’m wondering if you could help me by setting up the PLL clocks using the xrfclk command.
I build a PYNQ image for the ZCU208 with Ubuntu 20.04, Vivado 20.2 and the associated petalinux and bsp files.

I added the .spec file and the two tics files as mentioned here: ZCU216-PYNQ

I was able to build the image, juypter notebook does launch, and I can also download the bitstream file. The scope shows me the correct signal I just generated with the DAC.
However, the frequency is wrong, since I still have to set the lmx and lmk clocks accordingly.
Running xrfclk.set_ref_clks() shows the following error message:

It seems that the error appears in _find_devices. Somehow the program can’t find a “lmk…” or “lmx…” device in the /sys/bus/spi/devices folder.

So I used Putty to check this path on my board. If I run the Python code in the command window or just check the path I find the file p90jedec,spi-nor. But nothing with “lmk” or “lmx”. Because of that, the lmx_devices or lmk_devices list stay empty and hence print the error messages.

Do you have an idea if I may forgot something during the image build process? Do I need to run a specific command to initialize the clock board? Why can’t I find files with “lmk” or “lmx”? Is this an issue with the bsp file?

My current workaround is to define the clocks manually by the Xilinx BoardUI.
I think, this issue is also related to this topic.

Really appreciate your help.

Best regards

Hi there,

Have you added a device tree entry for clk104 like in the ZCU216-PYNQ repo? I think these are the entries you are likely missing.


Hi Shawn,

Thank you very much for your reply.
Indeed we forgot to add all the packages for the spi, which are provided in the ZCU216 image.
After we added them, the error message was gone.

We are now able to set (some?) clocks from PYNQ. Unfortunately, we still did not fully understand how that works.

In our Vivado design we set our LMK clock to 245.76 MHz and our LMX clock to 245.76 MHz.
We enable the use of the DAC/ADC PLLs.
That means, for our 3.932 GHz sampling clock we have to provide a reference clock of 245.76 MHz.
Before PYNQ, we always used the Xilinx BoardUI to set the LMK and then the LMX ADC and LMX DAC frequencies:

So we understood that we need to set three frequencies in PYNQ: the LMK, the LMX ADC and LMX DAC frequency. But if we try that, the LMX clock is shown as unvalid…
So it seems to us, that only the LMK clock is set, but not the LMX.
If we look on our clk104 add-on board, we also see, that only DS4 and DS1 is on, but not DS3…
Do we understand this wrong? How would we set the clocks from PYNQ? How can we interpret the values shown by xrfclk._Config?

Thanks for your help!

1 Like

Hi Patrick,

There’s a readme on the pynq xrfclk package, which has some useful info in terms of clocks and how this is done in PYNQ.

The output of the xrfclk._Config you are seeing are the register values from one of the tics .txt configs in the xrfclk package. If the frequency you want to program your LMX clocks does not exist in that folder (all the .txt files here that come with the package in addition to the 2 you have from the zcu216 project), then you need to create a new one using tics pro software for your chip/frequency and add it to that folder in your installation path.


Hi all,

we have finally been able to create the ZCU208 PYNQ image.
Furthermore, we wrote our own function which reads the whole clock configuration from the .hwh or .bit files and automatically configures the LMK and LMX clock.

The README documentation will be completed soon.

You can find the image and the clock function in our Github organization:
Institute of Photonics and Quantum Electronics - KIT (github.com)

We hope that this will save many of you a lot of time and nerves.

We hope that this may help you.


1 Like

Hello patrickmatalla!

Thanks for sharing your ZCU208 development with us.

I am in my first steps with the ZCU208 and PYQN. I’ve found your ipq-pynq-utils package, needed to handle clk104’s clocks generation from pynq. I have installed the package in the official ZCU208 PYNQ image (v3.00) but it fails at initializing the board. See the script an the outputs bellow:

import ipq_pynq_utils
board = ipq_pynq_utils.boards.ZCU208Board()

FileNotFoundError Traceback (most recent call last)
Input In [3], in <cell line: 4>()
1 #board = ipq_pynq_utils.ZCU208Board()
2 #board.print_clock_summary()
3 #print(list(board))
----> 4 board = ipq_pynq_utils.boards.ZCU208Board()

File /usr/local/share/pynq-venv/lib/python3.10/site-packages/ipq_pynq_utils/boards.py:212, in ZCU208Board.init(self, lmk_srcfile)
209 self.lmk_srcfile = lmk_srcfile
210 self.clk104 = CLK104(lmk_srcfile)
→ 212 self.spi_lmk = spidev.SpiDev(1, 1)
213 self.spi_dac = spidev.SpiDev(1, 2)
214 self.spi_adc = spidev.SpiDev(1, 3)

FileNotFoundError: [Errno 2] No such file or directory

It seems to be something related with SPI interfaces. Any idea on what could happend?

Thank you in advance!