How can I establish hardware-in loop implementation of PYNQ-Z2 on MATLAB using filWizard?
Show older comments
Hello, I am trying to connect my Xilinx FPGA board (PYNQ-Z2) from TUL with MATLAB and perform hardware in loop simulation on Simulink. However, I am not able to establish connection between FPGA and MATLAB. Could you please guide me what steps do I need to follow to solve this error.
To stop the test, press "Ctrl+C" in the MATLAB console window.
Starting FPGA-in-the-Loop test ...
Generating FPGA programming file ...Passed
Programming FPGA ...Passed
Running FIL simulation ...Failed
Error:Failed to initialize the RTIOStream library.

(a) Xilinx PYNQ-Z2 FPGA board (b) Shorted JTAG Enable Pins
The configuration that I have done on the "New FPGA Board Wizard" for adding customized boards in MATLAB HDL Coder are as shown below.




For you kind reference, I am using
OS: Ubuntu 22.04.5 LTS OS,
FPGA: Xilinx PYNQ-Z2 (from TUL),
MATLAB Version: R2024b
Vivado Version: 2023.2 (ML Standard)
Any suggestions and support would be greatly appreciated. Thank you in advance for your time and support.
Answers (1)
YP
on 28 Dec 2024
0 votes
Please try the following changes in the FPGA board wizard:
- Clock Frequency: 125MHz
- Clock Pin number: H16
Also connect the Ethernet port of this board to another Gig Etherner port, e.g. from PC/Switch/Router, using a Ethernet cable, since the Ethernet PHY should be active to generate the PL clock.
Run the validation step again.
5 Comments
Bharat Bohara
on 28 Dec 2024
Edited: Bharat Bohara
on 29 Dec 2024
YP
on 29 Dec 2024
can you unplug the ethernet, and try again?
I found in this blog, the author can use 125MHz clock (H16) to drive LED without connecting the ethernet.
https://blog.umer-farooq.com/a-pynq-z2-guide-for-absolute-dummies-part-iii-tick-tock-using-fpga-clock-33a34ef3f51a
Bharat Bohara
on 27 Feb 2025
YP
on 28 Feb 2025
The FIL test passed for me. I am using the same jumper setting as you did, and Ethernet is not connected. I've attached my zipped board file. It should be the same as yours anyway.
By the way, I am testing on Windows. There could be driver issues on your Ubuntu. Try manually installing the FTDI driver and Adept runtime.
And can you try on a Windows machine?

Bharat Bohara
on 28 Feb 2025
Categories
Find more on AMD FPGA and SoC Devices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


