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
Patrick

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.

Thanks
Shawn

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!
Best
Patrick

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.

Thanks
Shawn