Run Hello World on a ZC702

xilinx_logo_1

This post shows how run Hello World on a Xilinx ZC702. It covers: creating a design in Vivado, exporting the design to the SDK and running Hello World on the dual-core ARM Cortex-A9 processor in the Zynq-7000.

Contains

Part I: Build a PS and Generate a Bitstream

Part II: Export Hardware Design and the Open SDK

Parr III: Set up the ZC702

Part IV: Set up the Terminal

Part V: Run HelloWorld

Part VI: Debug HelloWorld

Note

This write up follows the steps presented in Zynq-7000 All Programmable SoC: Embedded Design Tutorial and adds corrections, clarifications and additional information.

Versions

  • Vivado 2018.2 available @ [link] (install the free WebPACK edition)

  • Windows 7 SP1

Part I: Build a PS and Generate a Bitstream

Step 1: Start Vivado 2018.2

A. Click Start

B. Click Vivado 2018.2

click_vivado_2

Step 2: Click Create Project

create_project_3

Step 3: Click Next

next_on_new_project_4

Step 4:

A. Set Project name to helloworld (always use a name without spaces [moreinfo])

B. Set Project location to C:/vivadoprjs (keep paths less than 200 chars)

C. Check the Create project subdirectory checkbox

D. Click Next

set_project_name_5

Step 5:

A. Select the RTL Project radio button if its not selected

B. Check the Do not specify source at this time checkbox

C. Click Next

select_rtl_project_6

Step 6:

A. Click Boards

B. Type ZC702

C. Click the ZYNQ-7 ZC702 Evaluation Board

D. Click Next

select_zc702_7

Step 7: Click Finish

finish_new_project_8

Text Listed, More Info and Links to Docs

New Project Summary

A new RTL project named ‘helloworld’ will be created.

The default part and product family for the new project:

Default Board: ZYNQ-7 ZC702 Evaluation Board

Default Part: xc7z020clg484-1 [speedgrade and part # decode (datasheet p.23)]

Product: Zynq-7000 [product page]

Family: Zynq-7000

Package: clg484 [Pinout Files & Packaging and Pinout p.79]

Speed Grade: -1

Step 8: Click Create Block Design

create_block_design_9

Step 9: Use defaults and click OK

use_block_design_defaults_10

Step 10: Click + to add IP (or Ctrl-I)

add_ip_11

Step 11:

A. Type Zynq

B. Double click on ZYNQ7 Processing System

find_zynq_processing_system_12

You’ll see the Xilinx LogiCORE™ IP Processing System 7 core [doc]:

zynq_block_13

Interfaces:

M_AXI_GP0_ACLK (input, global clock, all signals sampled on rising edge of the global clock)

DDR

FIXED_IO

M_AXI_GP0

FCLK_CLK0 (output, fabric aka PL clock, clock for the PL)

FCLK_RESET0_N

Step 12: Click Run Block Automation

run_block_automation_14

Step 13: Use defaults and click OK

use_block_automation_defaults_15

You’ll see:

block_automation_result_16

Step 14: Connect the PL clock (FCLK_CLK0) to the global clock (M_AXI_GP0_ACLK)

A. Click and hold on FCLK_CLK0

B. Drag the connection to M_AXI_GP0_ACLK and release mouse button

connect_pl_to_global_clock_17

You should see:

connection_successful_18

Step 15: Create an HDL Wrapper

A. Click Sources

B. Click Hierarchy

C. Right-click design_1 (design_1.bd)

D. Click Create HDL Wrapper…

create_hdl_wrapper_19

Step 16:

A. Leave or select Let Vivado manage wrapper and auto-update

B. Click OK

let_vivado_manage_wrapper_20

Step 17:

A. Click to expand design_1_wrapper (design_1_wrapper.v)(1)

B. Right-click on design_1_i: design_1 (design_1.bd)(1)

C. Click Generate Output Products…

generate_output_products_21

Step 18:

A. Leave selected or select Out of context per IP

B. Leave Number of jobs at 2

C. Click Generate

set_output_products_22

Step 19: Click OK and let the operation complete

confirm_generate_output_products_23

Step 20: Click Run Synthesis

run_synthesis_24

Step 21: Use the defaults and click OK

use_runs_defaults_25

Wait for synth_design to complete

running_synth_design_26

Step 22:

A. Leave selected or select Run Implementation

B. Click OK

synthesis_completed_27

Step 23: Use the defaults and click OK

use_run_defaults_28_use_again

Wait for the operation to complete:

initializing_design_29

running_opt_design_30

running_route_design_31

Complete:

implementation_complete_32

Step 23:

A. Select Generate Bitstream

B. Click OK

implementation_completed_33

Step 24: Use the defaults and click OK

use_run_defaults_28_use_again

Wait for the operation to complete:

running_write_bitstream_34

Complete:

write_bitstream_complete_35

Step 25: Click Cancel

bitstream_generation_completed_36

Part II: Export Hardware Design and the Open SDK

Step 1:

A. Click File

B. Click Export

C. Click Export Hardware

export_hardwear_37

Step 2:

A. Click the Include bitstream checkbox

B. Leave ****

C. Click OK

export_options_38

Step 3:

A. Click File

B. Click Launch SDK

launch_sdk_39

Step 4: Use defaults and click OK

use_sdk_defaults_40

Step 5:

A. Click File

B. Click Application Project

seelct_application_project_41

Step 6:

A. Type HelloWorld for Project name

B. See HelloWorld_bsp autopopulate

C. Click Next

select_project_name_42

Step 7:

A. Ensure Hello World is selected (it should be)

B. Click Finish

select_hello_world_43

You should see:

project_files_44

Part III: Set up the ZC702

Step 1: Set SW16 to JTAG mode [mode documentation see p.16]

set_sw16_to_jtag_45

For the rest of the jumpers see the high-resolution photo of the board in the correct state at [link].

Step 2: Connect a Micro-B to Type-A (host connection) USB cable from U23 (Diglent USB JTAG interface) to the host PC

U23:

u23_46

Micro-B connector:

micro_b_connector_47

Type-A connector:

type_a_connector_48

Step 3: Connect a Mini-B to Type-A (host connection) USB cable from J17 (CP2103GM USB-to_UART Bridge) to the host PC.

J17:

j17_49

Mini-B connector:

mini_b_connector_50

Type-A connector:

type_a_connector_51

Step 4: Power on the board (you’ll need to power on the board to see the USB-to-UART device in the next step).

turn_board_on_52

Part IV: Set up the Terminal

Step 1: Install the Silicon Labs CP210x USB to UART Bridge VCP Drivers

A. Goto [link]

B. Download and unzip the correct installer

C. Install the driver (I did not need to restart on Windows 7 SP1)

D. Click Windows

E. Click Devices and Printers

devices_and_printers_53

F. You should see Silicon Labs CP210x USB to UART Bridge

G. Note the COM port (you’ll need this later)

note_com_port_54

Step 2:

A. Click Window

B. Click Show View

C. Click Other

click_show_view_55

Step 3:

A. Expand Terminal

B. Click Terminal

C. Click OK

click_terminal_56

Step 4: Click Settings

click_settings_57

Step 5:

A. Use the COM port listed in Devices and Printers (or type it in: COM9 for instance)

B. Click OK

enter_com_port_58

Part V: Run HelloWorld

Step 1: Run Debug once

A. Right click HelloWorld

B. Click Debug As

C. Click Launch on Hardware (System Debugger)

launch_on_hardware_59

D. Click Yes

fpga_configuration_60

E. Click Yes

confirm_perspective_switch_61

Step 2:

A. Click Run

B. Click Run Configurations…

run_configurations_62

Step 3:

A. Make sure System Debugger using Debug_HelloWorld.elf on Local is selected

B. Check the Reset entire system check box

C. Check the Program FPGA check box

D. Ensure the Run ps7_init check box is checked

E. Ensure the Run ps7_post_config is checked

F. Click Apply

G. Click Run

config_system_debugger_63

H. Switch back to the C/C++ View

switch_back_to_c_c++_view_64

You should see:

hello_world_65

Step 4: Run the program again

A. Click Run

B. Click Run (this will use the Run Config you set up previously)

run_again_66

C. Click OK

confirm_debug_relaunch_67

You should see another Hello World:

hello_world_again_68

Part VI: Debug HelloWorld

Step 1: Click to disconnect Run terminal

click_disconnect_69

Step 2:

A. Click Run

B. Click Debug Configurations…

debug_configurations_70

Step 3:

A. Make sure System Debugger using Debug_HelloWorld.elf on Local is selected

B. Make sure the Reset entire system check box is checked

C. Make sure theProgram FPGA check box is checked

D. Ensure the Run ps7_init check box is checked

E. Ensure the Run ps7_post_config is checked

F. Click Apply if anything changed (the Apply button will be grayed out if no changes were needed).

G. Click Debug

configure_debug_options_71

H. Click Yes

confirm_perspective_switch_72

You should see:

debug_screen_73

Step 4: Connect the serial port

A. Click SDK Terminal

B. Click the ’+’ (Connect to serial port.)

connect_to_serial_port_74

C. Use these settings and click OK

use_serial_port_75

You should see:

connected_to_com9_76

Step 5: Click Resume (F8)

resume_program_77

You should see:

hello_world_78

Step 6: Restart Debug

A. Click Run

B. Click Debug (this will use the Debug Config you set up previously)

click_debug_79

C. Click OK

debug_session_relaunch_80

You should again see:

debug_screen_81

Note: to disconnect the debuggers serial port click here:

disconnect_debuggers_serial_port_82

You should see:

com9_disconnected_83

References