News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

How do I program my ZynqBerry from a virtual machine?

Started by tmaintz, December 28, 2016, 12:39:24 AM

Previous topic - Next topic

tmaintz

Hey there!

I got myself a TE0726-03 and want to get started with FPGA. My Laptop is a MacBook Pro and I use Ubuntu in a virtual machine for developing the software and flashing the board. In the net I found a tutorial for some first steps with the ZynqBerry written by Joel Svensson (http://www.cse.chalmers.se/~joels/writing/ZynqOpenCL.pdf). He was very kind for some questions I had but he could not help me with the following problem(s).

Everytime I open a terminal the settings64.sh in the vivado directory are called automatically (by .bashrc - to be shure all paths are set), then I start vivado from the terminal. My project files are exactly the same as given by the tutorial, no changes no fancy custom addons. When I plug the ZynqBerry into my laptop I connect the board directly into the virtual machine with an usb filter. I see with "lsusb" the vendor and product id and therefore it should be connected with the Ubuntu system. The LEDs right next to the micro usb port are blinking when plugged (but not later on, the red one flashes 6 times in total).

In Vivado all checks of the design result in no errors. When I open the SDK the code compiles with no errors too. Then I want to flash the FPGA from the SDK (I choose debug on hardware, reset the entire system and flash the FPGA). Here's the problem:

Everytime I want to debug with the vivado sdk an error occures: Error while launching program:
Could not find FPGA device on the board for connection 'Local'.


Troubleshooting hints:
1. Check whether board is connected to system properly.
1. In case of zynq board, check whether Digilent/Xilinx cable switch settings are correct.
1. If you are using Xilinx Platform Cable USB, ensure that status LED is green.
Could not find FPGA device on the board for connection 'Local'.

Troubleshooting hints:
1. Check whether board is connected to system properly.
1. In case of zynq board, check whether Digilent/Xilinx cable switch settings are correct.
1. If you are using Xilinx Platform Cable USB, ensure that status LED is green.


Is there any trick to get the tutorial working or are there other ways to get started?
I am happy about any answer / hint / another tutorial :)

Greetings
Thomas

JH

Hi,

was the step to program the FPGA successfully and only debugging is not running? 

If the FPGA programming also failed, can you check this:
  Has you installed Cable drivers on Vivado installation? Can you check, if the FPGA is visible with Vivado Hardware Manager?

If FPGA programming was successfully and  debugging is failed only:
  Did you used the correct board part files for Vivado PS configuration? --> Did you have a TE0723-03m or TE0726-03r (less memory, like in the ZynqOpenCL description)?
    If some settings are not correct, the system can be freeze and no JTAG access is available.
  Has you test the PCB with one of our demo designs or a simple Hello Word project with Vivado PS only? Was this OK?


br
John

tmaintz

#2
Hi John,

thanks for your answer, I made some progress but still got stuck. Until now I didn't use any example files and my Version is the 03M. Here's what I did for the OpenCL Tutorial:

The virtual machine did _not_ had the cable drivers installed. I changed that by navigating into the Xilinx Vivado directory and performed the install script via sudo.

$ cd /Xilinx/Vivado/2015.4/data/xicom/cable_drivers/lin64/install_script/install_drivers
$ sudo ./install_drivers

Now the cable drivers are correctly installed and I am able to see the Zynq in the hardware manager. So that was the first problem.

Now I have another error from the Debug view
1. Check whether board is connected to the system properly.
2. In case of zynq board, check whether Digilent/Xilinx cable switch settings are correct.
3. If you are using Xilinx Platform cable USB, ensure that status LED is green.

  Connection to Board Failed
    Failed to open Cable Node jsn-JTAG-ONB4-251633000A89A-000000ff-0 on TCP:127.0.0.1:3121


Ok, so I programmed the FPGA from the Vivado and not from the SDK, that works without error and the green LED lights up all the time. But it does not work like described in the tutorial. Anyone else had experience with the document? The screen command didn't worked too.

Long story short:
- cable drivers had been missed but now installed and I can open the target
- I can not program my device from the SDK (but from the Vivado itself)
- The green LED is not always on

Update: I can program the ZynqBoard from the Hardware Manager and it exits with no errors. I can start the system debugger but then the device says it is powered off somehow.

JH

Hi,

did you program the flash with Boot.bin or only the FPGA with *.bit? Bitfile (*.bit) is only for PL part  not PS. If you configure the Flash with a corrupted Boot.bin, it's also possible that the JTAG is not accessible by SDK.

I've never tried the tutorial from ZynqOpenCL.pdf , so I can't say if this is running correct with the larger Memory version.

Can you try a simple "Hello Word" with PS Project only --> UART is ps7_uart_1 on ZynqBerry.
https://wiki.trenz-electronic.de/display/PD/Vivado+Board+Part+Flow
https://wiki.trenz-electronic.de/display/PD/SDK+Projects

It's also possible that's the cable driver was not installed correct with separate installation, so SDK did not used this correct. Maybe you should reinstall Vivado/SDK with with cable drivers selected?

br
John

tmaintz

Thanks for the answer! This time I try to describe more than before so you can get the whole picture.

FYI
To be sure everything is correct installed a reinstall was made. In this procedure the guideline was by the Xilinx official install document (https://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_1/ug973-vivado-release-notes-install-license.pdf). I've done that on a virtual Ubuntu computer. In the meantime I tried Windows7 too but there I was not being able to see the board in the hardware manager (which I did on Ubuntu so I switched back).

On Linux the cable drivers had to be installed from a subdirectory (which had to be done via sudo)

Script Directory: <Vivado Install Dir>/data/xicom/cable_drivers/lin64/install_script/install_drivers/
Script Name: install_drivers


That leads to

Installing cable drivers.
Script name = ./install_drivers
HostName = thomas-zynq
Current working dir = /Xilinx/Vivado/2015.4/data/xicom/cable_drivers/lin64/install_script/install_drivers
Kernel version = 4.4.0-57-generic.
Arch = x86_64.
Installer version = 2015
USB udev file exists and will not be updated.
--File /etc/udev/rules.d/52-xilinx-pcusb.rules exists.
--File /etc/udev/rules.d/52-xilinx-pcusb.rules version = 0002
--File 52-xilinx-pcusb.rules exists.
--File 52-xilinx-pcusb.rules version = 0002
--File 52-xilinx-pcusb.rules is already updated.

Digilent Return code = 0
Xilinx Return code = 0
Return code = 0
Driver installation successful.


Everytime a terminal is opened the ~/.bashrc is executed which got a line I need to write on Linux
source <Vivado Install Dir>source settings64.sh
I open the Vivado tools always from the terminal so I am sure that these scripts are executed before I work.

So I reinstalled the Webpack Version of Vivado 2015.4. Let's work with a clean install, that might get some errors out of the line ;)

With the command lsusb I checked the connection of the ZynqBerry, here's my shell output

$lsusb
Bus 001 Device 017: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
Bus 001 Device 016: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The Dual USB-UART is the ZynqBerry (FTDI chip) which does not occur if I unplug it.

Restart.

My progress on the (new started) HelloWorld project:
First of all I copied the board files from the demo2 directory into the Vivado board_files directory.

I checked the hardware manager for the ZynqBerry, it's connected and the Tcl output is

INFO: [Labtoolstcl 44-466] Opening hw_target localhost:3121/xilinx_tcf/Digilent/251633000A89A
current_hw_device [lindex [get_hw_devices] 1]
refresh_hw_device -update_hw_probes false [lindex [get_hw_devices] 1]
INFO: [Labtools 27-1434] Device xc7z010 (JTAG device index = 1) is programmed with a design that has no supported debug core(s) in it.


The delivered demo files only work on a windows PC. All the *.bat files are not executeable on Linux. But I created the reference project from https://wiki.trenz-electronic.de/display/PD/Project+Delivery#ProjectDelivery-Reference-Design:GettingStarted and transfered them onto the Ubuntu system.

In the welcome window of vivado I executed the Tcl Code reinitialise_all.tcl with this result

Info:(TE) Following Script Versions used:
Batchfile:                                  NA
Vivado Version:                             Vivado v2015.4 (64-bit)
Script Version:                             2016.2.07
Board Part (Definition Files) csv Version:  1.2
Software IP csv Version:                    1.9
Board Design Modify csv Version:            1.1
ZIP ignore csv Version:                     1.0
------------------------------------------
------------------------------------------
Info:(TE) Following Environment is set:
Vivado Setting:     0
LabTools Setting:   0
SDK Setting:        0
SDSOC Setting:      0
------------------------------------------
------------------------------------------
Info:(TE) Initial Project Name and Paths:
TE::VPROJ_NAME:           Documents
TE::VPROJ_PATH:           /home/thomas/Documents/vivado
TE::VLABPROJ_PATH:        /home/thomas/Documents/vivado_lab
TE::BOARDDEF_PATH:        /home/thomas/Documents/board_files
TE::FIRMWARE_PATH:        /home/thomas/Documents/firmware
TE::IP_PATH:              /home/thomas/Documents/ip_lib
TE::BD_PATH:              /home/thomas/Documents/block_design
TE::XDC_PATH:             /home/thomas/Documents/constraints
TE::HDL_PATH:             /home/thomas/Documents/hdl
TE::SET_PATH:             /home/thomas/Documents/settings
TE::WORKSPACE_HSI_PATH:   /home/thomas/Documents/workspace/hsi
TE::WORKSPACE_SDK_PATH:   /home/thomas/Documents/workspace/sdk
TE::LIB_PATH:             /home/thomas/Documents/sw_lib
TE::SCRIPT_PATH:          /home/thomas/Documents/scripts
TE::DOC_PATH:             /home/thomas/Documents/doc
TE::PREBUILT_BI_PATH:     /home/thomas/Documents/prebuilt/boot_images
TE::PREBUILT_HW_PATH:     /home/thomas/Documents/prebuilt/hardware
TE::PREBUILT_SW_PATH:     /home/thomas/Documents/prebuilt/software
TE::PREBUILT_OS_PATH:     /home/thomas/Documents/prebuilt/os
TE::LOG_PATH:             /home/thomas/Documents/v_log
TE::BACKUP_PATH:          /home/thomas/Documents/backup
TE::ZIP_PATH:             
TE::SDSOC_PATH:           /home/thomas/Documents/sdsoc
TE::XILINXGIT_DEVICETREE:
TE::XILINXGIT_UBOOT:     
TE::XILINXGIT_LINUX:     
------------------------------------------
Info:(TE) Initial Board definition list from /home/thomas/Documents/board_files/TE0726_board_files.csv
------------------------------------------
Info:(TE) Read Software list from /home/thomas/Documents/sw_lib/apps_list.csv
------------------------------------------
Info:(TE) Read ZIP Ignore list from /home/thomas/Documents/settings/zip_ignore_list.csv
------------------------------------------
------------------------------------------
Info:(TE) Following Attributes currently not refreshed:TE::VIVADO_AVAILABLE,TE::LABTOOL_AVAILABLE,TE::SDK_AVAILABLE, TE::SDSOC_AVAILABLE+Xilinx SDSOC Scripts
WARNING: [Coretcl 2-89] No projects matched '*'
Info:(TE) Reinitial Vivado.
WARNING: [Coretcl 2-89] No projects matched '*'
Error:(TE) Inconsistent project name, get project , expected Documents from project folder

    while executing
"reinitialise"
    (file "./reinitialise_all.tcl" line 110)


I opened the project and got the following errors

[Project 1-19] Could not find the file '/home/thomas/Documents/constraints/_i_rpi_gpio.xdc'.


No Block design was available. So I created one like https://wiki.trenz-electronic.de/display/PD/Vivado+Board+Part+Flow but the validation said there is no valid clock source on the M_AXI_GP0_ACLK and did not let me further so I deactivated that one (did I messed up?). Then I used the TE script TE::hw_build_design result:

Exporting to file /home/thomas/Documents/TE-HelloWorld/test_board_v3.srcs/sources_1/bd/design_1/hw_handoff/design_1.hwh
Generated Block Design Tcl file /home/thomas/Documents/TE-HelloWorld/test_board_v3.srcs/sources_1/bd/design_1/hw_handoff/design_1_bd.tcl
Generated Hardware Definition File /home/thomas/Documents/TE-HelloWorld/test_board_v3.srcs/sources_1/bd/design_1/hdl/design_1.hwdef
Error:(TE) Script (TE::VIV::run_synth) failed: ERROR: [filemgmt 20-730] Could not find a top module in the fileset sources_1.
Resolution: With the gui up, review the source files in the Sources window. Use Add Sources to add any needed sources. If the files are disabled, enable them. You can also select the file and choose Set Used In from the pop-up menu. Review if they are being used at the proper points of the flow.
.
Error:(TE) Script (TE::VIV::build_design) failed: .


So that's the new point where I got stuck again :(
Does anyone got similar problems on their first stepts with a FPGA?

Thanks for any answers I really appreciate the help of you!

Greets,
Thomas

By the way: what is PL and PS?

tmaintz

Okay I am too late to modify the last post so here is my next progress:

Just found the HelloWorld Topic
https://forum.trenz-electronic.de/index.php?topic=479.0

I'm listen to the USB port via
$sudo screen /dev/ttyUSB1 and get just a "w" when I start to debug the program

Later I got the console error (within eclipse): Remote failure reply: E01

Anyone knows what that is?

So it seems that I can program my device from the virtual machine in the SDK. That means the selfbuilt board layout in Vivado has got some errors... But that is not a question for this topic but a new one.

-> I try further and seek through the whole forum posts about any similar conversation.

JH

Hi,

Can you please answer my last question first:
Did you program the flash with Boot.bin or only the FPGA with *.bit?

For Reference Designs: You tried to start a vivado 2016.2 reference design with vivado 2015.4. This is not working. The reference designs are only for the indicated vivado version. You can only use the prebuilts to test the pcb or you must install the corresponding vivado version.
I know the batch files are for Windows only, but you can also start the reference design on linux with option2 of this description: https://wiki.trenz-electronic.de/display/PD/Installation
To connect serial console on linux see: https://wiki.trenz-electronic.de/display/PD/Reference+Designs+with+PetaLinux

For simple hello world you did not need the reference design or any scrips from us:
1: Install Board parts (option 2 or 3) discribed here: https://wiki.trenz-electronic.de/display/PD/Installation
2. New Vivado Project with empty block design: https://wiki.trenz-electronic.de/display/PD/Vivado+Board+Part+Flow
3. Create Top Level wrapper (source window-->right click on Blockdesign-->Create HDL Wrapper-->Let Vivado anage wrapper...)
4. Export HDF and  create SDK project (SDK and Vivado should be the same version): https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-Variant(b):UseXilinxGUIExport
5. Create Hello World Project : https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-Variant(b):UseXilinxGUIExport
6. Modify BSP with UART 1: https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-ModifyBSP-Settings
7. Run Debugging: https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-DebugSoftwareApplication

I know you has no access with SDK, so at first I need to know if you programmed the flash with a own boot.bin?

You wrote you test with Windows 7. Did you use also a VM or native?

br
John



tmaintz

Thanks for your reply John!

Quote from: JH on January 06, 2017, 08:15:58 AM
Did you program the flash with Boot.bin or only the FPGA with *.bit?
I am really not sure. First I started the SDK and created the Hello World program like in the links you gave before. Whether the flash or just the FPGA is programmes I don't know. I did not used the program via Vivado or any scripts, just out of eclipse with reset entire system (in the debug on system gdb). At no time I have seen either the Boot.bin nor the *.bit file as I could identify them.

Quote from: JH on January 06, 2017, 08:15:58 AM
I know the batch files are for Windows only, but you can also start the reference design on linux with option2 of this description: https://wiki.trenz-electronic.de/display/PD/Installation
Done. No Errors.

Quote from: JH on January 06, 2017, 08:15:58 AM
To connect serial console on linux see: https://wiki.trenz-electronic.de/display/PD/Reference+Designs+with+PetaLinux
Wrote a bash file for easier access.

Quote from: JH on January 06, 2017, 08:15:58 AM
1: Install Board parts (option 2 or 3) discribed here: https://wiki.trenz-electronic.de/display/PD/Installation
2. New Vivado Project with empty block design: https://wiki.trenz-electronic.de/display/PD/Vivado+Board+Part+Flow
3. Create Top Level wrapper (source window-->right click on Blockdesign-->Create HDL Wrapper-->Let Vivado anage wrapper...)
4. Export HDF and  create SDK project (SDK and Vivado should be the same version): https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-Variant(b):UseXilinxGUIExport
1. I choosed the TE0726-03M as the board layout.
2. Do you want me to create a blank design? Or should I insert the Zynq IP?
3. Done with an empty block design. It asked me to generate an output first. I did so. But that lead to a problem -> see attachment 1

So I implemented the Zynq IP into the block design. Because that generated another error I had to connect the pins M_AXI_GP0_ACLK with FCLK_CLK0. Then I started the validation, synthesis and implementation of the block design to generate a bitstream output. Success. Then I did the export Hardware including bitstream. Success

4. Done

Quote from: JH on January 06, 2017, 08:15:58 AM
5. Create Hello World Project : https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-Variant(b):UseXilinxGUIExport
6. Modify BSP with UART 1: https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-ModifyBSP-Settings
All went well.

Quote from: JH on January 06, 2017, 08:15:58 AM
7. Run Debugging: https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-DebugSoftwareApplication
Here I got different errors. Sometimes it says 'Could not find FPGA device on the board for connection "local" '. or "Invalid DAP ACK value: 0" (sometimes "value: 7") or "invalid context". Otherwise when I open the target on Vivado hardware Manager this error occurs (programming always via vivado sdk and debug on system)

ERROR: no targets found with "jtag_cable_name =~ " JTAG-ONB4 261633000A89A" && level==0". available targets:
1* APU
    2 ARM Cortex-A9 MPCore #0 (Running)
    3 ARM Cortex-A9 MPCore #1 (Running)
4 xc7z010

It seems that all errors differ from the time the ZynqBerry was plugged into the PC and either it was opened hardware or not.

Quote from: JH on January 06, 2017, 08:15:58 AM
I know you has no access with SDK, so at first I need to know if you programmed the flash with a own boot.bin?
I think not. I have nothing flashed but what I described above. Neither a flash or a SD card.

Quote from: JH on January 06, 2017, 08:15:58 AM
You wrote you test with Windows 7. Did you use also a VM or native?
This was a VM too.

JH

Quote from: tmaintz on January 06, 2017, 07:12:17 PM
Here I got different errors. Sometimes it says 'Could not find FPGA device on the board for connection "local" '. or "Invalid DAP ACK value: 0" (sometimes "value: 7") or "invalid context". Otherwise when I open the target on Vivado hardware Manager this error occurs (programming always via vivado sdk and debug on system)

ERROR: no targets found with "jtag_cable_name =~ " JTAG-ONB4 261633000A89A" && level==0". available targets:
1* APU
    2 ARM Cortex-A9 MPCore #0 (Running)
    3 ARM Cortex-A9 MPCore #1 (Running)
4 xc7z010

It seems that all errors differ from the time the ZynqBerry was plugged into the PC and either it was opened hardware or not.
I think not. I have nothing flashed but what I described above. Neither a flash or a SD card.
This was a VM too.
Maybe your VM has a problem with this drivers. Did you use Oracle VM or VMware?   Can you test JTAG on a native OS? How long is your USB-cable? Can you try a shorter cable. Did you connect direct to PC or did you use externel USB-HUB? If you power the ZynqBerry over USB, you should use USB2.0 or higher.

br
John

rshankle

Hi Folks,

I'm new with ZynqBerry and have spent the last week trying to get a demo to run.  I'm trying to work through the examples referenced in this thread but the instructions are 3 years old.  Xilinx has moved away from the SDK mentioned and now uses Vitis.

Is there a more current "Hello World" Example. 
Is there some basic instructions for just creating a SDCard for ZynqBerry that I can follow just to make sure the hardware boots up?

I've been following:  https://www.digikey.com/eewiki/display/Motley/Getting+Started+with+the+ZynqBerry#GettingStartedwiththeZynqBerry-Introduction

thanks for any pointers.  (Sorry I couldn't find the create new post button.)
Bob



JH

Hi,
you can check following reference designs and demos:
https://wiki.trenz-electronic.de/display/PD/TE0726+Reference+Designs
Designs are for Vivado/Vitis/Petalinux 19.2 and includes also prebuilt binaries for test.

Additional documentation regarding Xilinx software:
https://wiki.trenz-electronic.de/display/PD/Xilinx+Development+Tools

br
John