Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
reference:programmable-logic:eclypse-z7:developing-software [2020/01/08 12:45]
Vicentiu Neagoe [Developing User Space Software for Eclypse]
— (current)
Line 1: Line 1:
-====== Developing User Space Software for Eclypse ====== 
- 
-The demo that provided for the Zmods can be run from within SDK and maybe (as yet undecided) will be loaded into the image as a binary file in the intramfs. The following assumes that Xilinx SDK 2019.1 is used to run the demo. 
- 
-After booting Petalinux and reaching the Linux prompt, you can start running and tweaking the Zmod demo project using Xilinx SDK 2019.1. In order to set up your environment for it please follow this [[https://​xilinx-wiki.atlassian.net/​wiki/​spaces/​A/​pages/​18841623/​How+to+debug+Linux+Application+in+SDK+2019.1|wiki page]] provided by Xilinx. //Steps will be encapsulated by this guide.// 
- 
-The SDK workspace will be provided by Digilent and the code is currently designed to support both bare-metal and Linux. The user can switch between them through the use of a "#​define LINUX_APP"​ macro. However, this is a still a work in progress. 
- 
-This guide will walk the user through the process of setting up the demo and running it on the Eclypse, then modifying the demo to do //​something//​ interesting. It will be genericized such that any system personality can be used. 
- 
-==== 2.1. Delivery Structure ==== 
- 
-The library is delivered as one package of sources (structured on different folders), to be included (or linked) in the Linux or baremetal projects. 
- 
-We provide the following hierarchy as a 2019.1 Xilinx Vivado SDK workspace: 
-  * Zmod folder containing: 
-    * [[#​zmod_class|ZMOD base class]] sources: zmod.cpp, zmod.h 
-    * Platform dependencies common includes: reg.h, dma.h and flash.h. These headers expose the IP core register access, DMA and flash  functions that are dependent to the platform (Linux or baremetal). These functions will be implemented in the source files contained in the platform dependencies folders (Linux and baremetal) shown below. 
-    * Platform dependencies folders: 
-      * linux - contains separate folders that implement Linux platform related functionality (functions listed in platform dependencies common includes mentioned above) on Linux platform. ​ 
-      * baremetal - contains separate folders that implement baremetal related functionality (functions listed in platform dependencies common includes mentioned above) on baremetal platform. ​ 
-  * The folder named after specific Zmods contain its library. For example: ​ 
-    * Folder ZmodADC1410 contains: 
-      * ZmodADC1410 sources: zmodadc1410.cpp,​ zmodadc1410.h 
-    * Folder ZmodDAC1411 contains: 
-      * ZmodADC1411 sources: zmoddac1411.cpp,​ zmoddac1411.h 
-  * Folder ZmodADC1410_LinuxDemo contains the Linux demo project. Under src folder there are the following linked folders: 
-    * Folder Zmod links to WORKSPACE_LOC\Zmod 
-    * For each specific Zmod there is a folder pointing to WORKSPACE_LOC\<​specific Zmod location>​. For example: ​ 
-      * Folder ZmodADC1410 links to WORKSPACE_LOC\ZmodADC1410 
-      * Folder ZmodDAC1411,​ links to WORKSPACE_LOC\ZmodDAC1411 
-    * A main file implementing the Linux demo 
-  * Folder ZmodADC1410_BaremetalDemo contains the Baremetal project. Under src folder there are the following linked folders: 
-    * Folder Zmod links to WORKSPACE_LOC\Zmod 
-    * For each specific Zmod there is a folder pointing to WORKSPACE_LOC\<​specific Zmod location>​. For example: ​ 
-      * Folder ZmodADC1410 links to WORKSPACE_LOC\ZmodADC1410 
-      * Folder ZmodDAC1411 links to WORKSPACE_LOC\ZmodDAC1411 
-    * A main file, specific to the baremetal app 
-  * One folder ZmodADC1410_BaremetalDemo_bsp corresponding to the Baremetal project bsp. 
- 
----- 
-==== 2.2. Environment Setup ==== 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-=== 2.2.1. Download the library === 
-  * Download (clone) the [[#​delivery_structure|delivered sources]] to a specific location. This will be later used as Vivado SDK workspace location. 
-FIXME  
-<​code>​git clone --recursive https://​git.digilentinc.com/​digilent/​eclypse_z7/​eclypse_z7_sw.git -b demos/​next</​code>​ 
- 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​capture1.jpg |}} 
-</​WRAP></​WRAP>​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
- 
-=== 2.2.2. Add Vivado SDK workspace location ​ === 
- 
-  * The downloaded workspace contains demo applications for Linux and baremetal. ​ 
-  * <​optional>​ In the Vivado SDK workspace location, folders regarding Zmods that are not being used can be removed. Also, the folders corresponding to the project demos that are not wanted can be removed. 
-  * Open Vivado SDK 2019.1 and assign the workspace location to the library 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. 
-  * If you want to create your own project: 
-      * Create a new application project (Linux or baremetal). 
-      * Configure it as described on [[#​project_settings|Project Settings]] section.\\ ​ 
-  
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​capture2.jpg |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-=== 2.2.3. Import library to Vivado SDK  === 
-    * File -> Import 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​capture3.png?​450 |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
- 
-    * Select General -> Existing Projects into Workspace -> Next 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​capture4.png?​450 |}} 
-</​WRAP>​ </​WRAP>​ 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
- 
-    * Select the library download location ​ 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​capture5.jpg?​450 |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-=== 2.2.4. Vivado SDK Project Explorer === 
-FIXME change photos 
-    * If the user doesn'​t use the Linux demo, the ZmodADC1410_LinuxDemo project can be deleted or closed (right-click on project name->​Delete or Close Project) 
-    * If the user wants to use the Linux demo, then he must follow the steps from [[#​linux_project|Linux Project]] configuration under Project Settings section. 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​capture6.jpg |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-====== 4. Project Settings ====== 
- 
-This chapter details the configuration needed for the baremetal or Linux projects.\\ ​ 
-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|Delivery structure]]). 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-===== 4.1. Linux Project ===== 
-==== 4.1.1. Link Zmod Folder ==== 
-    * Under src folder, Right Mouse button option New / Folder 
-    * Select Advanced 
-    * Link to alternate location (Linked Folder) 
-    * Variables... / Select WORKSPACE_LOC 
-    * Extend... / Select Zmod folder 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_1.png |}} 
-</​WRAP></​WRAP>​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
- 
-==== 4.1.2. Link Zmod-Specific Folders ==== 
-For each used Zmod, link its folder. For example, to link the ZmodADC1410 folder: 
-    * Under src folder, Right Mouse button option New / Folder 
-    * Select Advanced 
-    * Link to alternate location (Linked Folder) 
-    * Variables... / Select WORKSPACE_LOC 
-    * Extend... / Select ZmodADC1410 folder 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_2.png |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-==== 4.1.3. Define LINUX_APP ==== 
-    * In the Project Explorer, right mouse button on the project, “C/C++ Build Settings” 
-    * In the “C/C++ Build” group, select “Settings” category 
-    * Select “ARM v7 Linux g++ linker”/​”Symbols” node 
-    * Add LINUX_APP definition (using the ‘+’ button) 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_3.png |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-==== 4.1.4. Add SYSROOT Environment Variable ==== 
-    * In the Project Explorer, right mouse button on the project, “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/​cristian/​eclypse/​os/​build/​tmp/​sysroots/​plnx-zynq7” 
- 
-**Note**: //In Petalinux 2019.1 in order to build the sysroot image is necessary to run the following command: // 
-<​code>​petalinux-build -c build-sysroots</​code>​ 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_4.png|}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-==== 4.1.5. Define Include Directories ==== 
-    * In the Project Explorer, right mouse button on the project, “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}/​../​../​Zmod//​** 
-      * **//​${CWD}/​../​../​ZmodADC1410//​** 
- 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_5.png |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-==== 4.1.6. Define Libraries and Library Directories ==== 
-    * In the Project Explorer, right mouse button on the project, “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//​** 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_6.png|}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-==== 4.1.7. Add “--sysroot” Project Setting ==== 
-    * In the Project Explorer, right mouse button on the project, “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}” 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_1_7.png |}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-===== 4.2. Baremetal Project ===== 
-==== 4.2.1. Link Zmod Folder ==== 
-    * Under src folder, Right Mouse button option New / Folder 
-    * Select Advanced 
-    * Link to alternate location (Linked Folder) 
-    * Variables... / Select WORKSPACE_LOC 
-    * Extend... / Select Zmod folder 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_2_1.png|}} 
-</​WRAP></​WRAP>​ 
- 
----- 
- 
-<WRAP GROUP> <WRAP COLUMN HALF> 
-==== 4.2.2. For each used Zmod, link its folder. For example, link ZmodADC1410 folder. ==== 
-    * Under src folder, Right Mouse button option New / Folder 
-    * Select Advanced 
-    * Link to alternate location (Linked Folder) 
-    * Variables... / Select WORKSPACE_LOC 
-    * Extend... / Select ZmodADC1410 folder 
- 
- 
-</​WRAP>​ <WRAP COLUMN HALF> 
-{{ :​reference:​programmable-logic:​eclypse-z7:​zmod6_2_2.png|}} 
-</​WRAP>​ </​WRAP> ​ 
- 
----- 
- 
- 
-