This is an old revision of the document!
Setting up an Environment for Working with Eclypse and the Zmod Library
This section contains the steps for setting the environment for setting up Baremetal projects and Linux project setup for both Zmod Scope and Zmod AWG. Depending on the user needs, one can either use the projects we deliver in their own development process or use the libraries in their projects. If the second case is considered, the user should apply the below described settings to his project, in order to be able to build it.
1. Import Library and Demo Projects
The steps below need to be followed in order to obtain a complete SDK workspace and to be able to build and run any of the projects, in either Linux or Baremetal platforms.
1.1. Linux Environment Project Setup
The ZmodADC1410_Demo_Linux and ZmodDAC1411_Demo_Linux are run from Xilinx SDK.
This step by step tutorial roughly follows the How to debug Linux Application in SDK 2019.1 by Xilinx, with some changes due to our Debian 10 rootfs.
The following steps are for the Eclypse Z7 board. If a Zmod Scope is used, it should be attached to the Eclypse Z7's ZMOD A port. If a Zmod AWG is used, it should be attached to the Eclypse Z7's ZMOD B port.
1.1.1. Download the Library
- Download the git repository containing the libraries and demos using the below command:
git clone --recursive https://github.com/Digilent/Eclypse-Z7-SW.git -b zmod_adc_dac/master
NOTE: If you choose to download the repository as ZIP, the folder zmodlib will not be populated and you will have to populate it manually.
- The delivery structure will be later used for the Xilinx SDK workspace.
1.1.2. Download the SD Card Image
- Download the latest eclypse-debian-buster-armhf-rfs.img_X.X.zip Petalinux image from the Eclypse Z7 git repository Releases and extract it on your PC.
- You need to expand the Assets section to see the files.
- Write the image to an SD card:
- Linux: in a terminal window use the following command:
dd if=/path/to/extracted/image/eclypse-debian-buster-armhf-rfs.img of=/dev/(sdX or mmcblkX} && sync
- Windows: use Rufus or Win32DiskImager.
- Connect the board to your Ethernet network.
- Insert the SD card and boot the board. On first boot, the rootfs partition will resize to fill the SD card then reboot.
- Open a Terminal and connect to the board via its USB-UART interface (labeled PROG).
- Login with username: eclypse and password: eclypse.
1.1.3. Add Xilinx SDK Workspace Location
- The downloaded workspace contains demo applications for both Linux and Baremetal.
- Open Xilinx SDK 2019.1 and assign the workspace location to the project download location.
- If you want to use the demo projects, open the desired Linux or Baremetal demo project. The projects are already configured and ready to be used, except the Linux project where SYSROOT environment variable must be set according to Add SYSROOT Environment Variable section.
1.1.5. Add SYSROOT Environment Variable in SDK
- Download the latest eclypse-debian-buster-armhf-sysroot_X.X.tar.xz (.zip for Windows ) sysroot from the Eclypse Z7 git repository's Releases page and extract it on your PC (the location of the extracted folder will be later used as the path for the SYSROOT Environment Variable)
Note: You need to expand the Assets section from github to see the eclypse-debian-buster-armhf-sysroot_X.X.tar.xz and .zip files.
Windows only: When prompted whether to replace existing files, choose to replace. - In the SDK Project Explorer, right click on the application project you wish to run, then click “C/C++ Build Settings”
- In the “C/C++ Build” group, select the “Environment” category
- Add the SYSROOT variable pointing to the location where eclypse-debian-buster-armhf-sysroot rootfs folder can be found. For example “/home/cosmin/Documents/eclypse-debian-buster-armhf-sysroot”
Windows: The SYSROOT environment variable if exists must be Deleted then reAdded to the list, rather than Editing the existing variable. - Click OK and wait for the Project to build
1.1.6. Find the Board IP Address
- In the UART Terminal connected to the board, log in with the username/password combination eclypse/eclypse
- Run the following command:
ip a
- Copy the IP address of the board, example: 10.0.0.168
1.1.7. Establishing Connection to the Board
- In the SDK Target Connections panel, open the Linux TCF Agent folder
- Right click on Linux Agent [default] and click Edit
- Enter the board IP address into the Host section
- Click Test Connection to make sure that SDK can communicate with the TCF-agent on the board
- Click OK
1.1.8. Run the Demo Project
To run the demo application, right-click on Project name → Run as → Launch on Hardware(System Debugger)
1.2. Baremetal Project Setup
1.2.1. Download the Library
Download the demo project with the below command:
git clone --recursive https://github.com/Digilent/Eclypse-Z7-SW.git -b zmod_adc_dac/master
NOTE: If you choose to download the repository as ZIP, the folder zmodlib will not be populated and you will have to populate it manually.
The delivery structure will be later used for the Xilinx SDK workspace.
1.2.2. Add Xilinx SDK Workspace Location
- The downloaded workspace contains demo applications for both Linux and Baremetal.
- Open Xilinx SDK 2019.1 and assign the workspace location to the project download location.
- If you want to use the demo projects, open the desired Baremetal demo project. The projects are already configured and ready to be used.
1.2.4. Xilinx SDK Project Explorer
- The ZmodADC1410_Demo_Linux and ZmodDAC1411_Demo_Linux projects must be closed or deleted from Project Explorer (right-click on project name→ Close Project or Delete)
1.2.5. Run the Demo Project
- Make sure the board is connected to your PC and it is powered on.
- Make sure the jumpers are set accordingly.
- Program the board: Xilinx → Program FPGA
- Run the demo application: right-click on project name → Run as → Launch on Hardware(System Debugger)
2. Create New Project or Use Libraries in your project
These steps are required when an SDK workspace is first opened by the user. The steps below need to be followed in order to obtain a complete SDK workspace and to be able to build and run any of the projects, in either Linux or Baremetal platforms.
2.1. Linux Environment Project Setup
2.1.1. Create New Project and Link zmodlib Folder
It is assumed that Zmod and specific folders for Zmods (ZmodADC1410 for example) are placed in the SDK workspace root folder, as provided by Digilent (see Delivery Structure).
- Create a new application project.
- Under src folder, right click option, select New / Folder
- Select Advanced
- Link to alternate location (Linked Folder)
- Variables… → Select WORKSPACE_LOC → Extend… → Select zmodlib folder
2.1.2. Add “–sysroot” Project Setting
- In the Project Explorer, right click on the project name, select “C/C++ Build Settings”
- In the “C/C++ Build” group, select “Settings” category
- Select “ARM v7 Linux g++ linker”/”Miscelaneous” node
- In the Linker Flags field add
--sysroot=${SYSROOT}
2.1.3. Define the LINUX_APP Symbol
- In the Project Explorer, right click on the project name, select “C/C++ Build Settings”
- In the “C/C++ Build” group, select “Settings” category
- Select “ARM v7 Linux g++ compiler”/”Symbols” node
- Add LINUX_APP definition (using the ‘+’ button)
2.1.4. Add SYSROOT Environment Variable in the SDK
- Download the latest eclypse-debian-buster-armhf-sysroot_X.X.tar.gz sysroot from Releases and extract it on your PC
- You need to expand the Assets section of the git page to find the file mentioned above
- In the Project Explorer, right click on the project name, select “C/C++ Build Settings”
- In the “C/C++ Build” group, select “Environment” category
- Add SYSROOT variable pointing to the location where Petalinux sysroot can be found. For example “/home/cosmin/Documents/eclypse-debian-buster-armhf-sysroot”
Note: In Petalinux 2019.1 in order to build the sysroot image is necessary to run the following command:
petalinux-build -c build-sysroots
2.1.5. Define Libraries and Library Directories
- In the Project Explorer, right click on the project name, select “C/C++ Build Settings”
- In the “C/C++ Build” group, select “Settings” category
- Select “ARM v7 Linux g++ linker”/”Libraries” node
- Add the following library in the “Libraries (-l)” list:
- uio
- Add the following directories in the “Library search path (-L)” list:
- ${SYSROOT}/usr/lib
- ${SYSROOT}/lib
2.1.6. Define Include Directories
- In the Project Explorer, right click on the project name, select “C/C++ Build Settings”
- In the “C/C++ Build” group, select “Settings” category
- Select “ARM v7 Linux g++ compiler”/”Directories” node
- Add the following directories:
- ${SYSROOT}/usr/include
- ${CWD}/../../zmodlib/Zmod
- ${CWD}/../../zmodlib/ZmodADC1410
2.2. Baremetal Project Setup
2.2.1. Create New Project and Link zmodlib Folder
It is assumed that Zmod and specific folders for Zmods (ZmodADC1410 for example) are placed in the SDK workspace root folder, as provided by Digilent (see Delivery Structure).
- Create a new application project.
- Under src folder, right click option, select New / Folder
- Select Advanced
- Link to alternate location (Linked Folder)
- Variables… → Select WORKSPACE_LOC → Extend… → Select zmodlib folder
2.2.2. Define Include Directories
- In the Project Explorer, right click on the project name, select “C/C++ Build Settings”
- In the “C/C++ Build” group, select “Settings” category
- Select “ARM v7 g++ compiler”/”Directories” node
- Add the following directories:
- ${CWD}/../../zmodlib/Zmod
- ${CWD}/../../zmodlib/ZmodADC1410



















