UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Running your programs on the MicroZed – Adam Taylor’s MicroZed Chronicles, Part 4

by Xilinx Employee ‎10-28-2013 10:11 AM - edited ‎01-11-2016 04:14 PM (74,291 Views)

So far in this series we have looked at creating the hardware system on the MicroZed board, setting up the software environment, and understanding the “hello world” program example. After three blogs it is time to pull this all together and get something running on the MicroZed so that you can see the results. We can use one of two methods to do this. We can use SDK to download and run the application in the Zynq All Programmable SoC’s on-chip RAM over a JTAG link or we can program a non-volatile memory and use a boot loader running on the Zynq SoC to load our application.

 

To keep things nice and simple in this blog post, we will download the application to RAM over the JTAG link. That’s the simpler of the two options and it’s of more use during debugging, at least initially.

 

The first step is to create a new run configuration: “project explorer -> project -> run -> run”, accessed from the right-click menu. This new configuration is created under the C/C++ ELF type on the left side of the dialog box:

 

 

Figure 1 Creating a new project configuration.jpg

 

 

 

Once we have created a new configuration, we can define our STDIO connection as the serial port that we will use for the STDIO—if any—along with processor reset options and debug / profiling options. (I tend to use a standalone terminal program for debugging.)

 

 

Figure 2 Setting the Debug Options.jpg

 

 

Once we are happy with the configuration, we can apply and then close it. However, at this point we’re not yet ready to run anything. There’s one more step.

 

The final step is to connect the MicroZed board to our PC and program the Zynq by downloading the previously compiled software. First, we connect both the JTAG cable and the USB (RS232) power cable to the MicroZed. Following this we can program the hardware via the JTAG connection using the “Xilinx tools -> program FPGA” option, which checks that the bit file is the correct one and then programs the device.

 

Before we download the software we must ensure we have a terminal program open on the PC so that we can see communications from the MicroZed board. We set the UART to 115200 baud, no parity, and one stop bit.

 

Having completed the configuration we can now download our ELF file and try out our program. This is as simple as selecting our project within the project explorer, right clicking, selecting “Run As”, and then “Launch on Hardware.” If we had not previously built or compiled our code, this procedure would automatically build our design for us, provided it is error free.

 

 

Figure 3 Running the Program using Launch on Hardware.jpg

 

 

 

When you initiate the program launch, you will see a progress bar within SDK. Once the download completes, you should see the output from your application in the terminal window. Hopefully, it looks something like this:

 

 

Figure 4 Debug monitor in terminal window.jpg

 

 

 

In my next blog we will create a First Stage Boot Loader so that we can boot the MicroZed from non-volatile memory.

 

 

Note: Please see the previous entries in this series by Adam Taylor:

 

Zynq and MicroZed say “Hello World”-- Adam Taylor’s MicroZed Chronicles, Part 3

 

Adam Taylor’s MicroZed Chronicles: Setting the SW Scene

 

Bringing up the Avnet MicroZed with Vivado

 

 

 

 

Comments
by Newbie smerkeltx
on ‎11-22-2013 01:46 PM

Nice and easy.  Really, I am looking for a how to on FSBL and how to include my ELF design to boot up all the time.  Look forward to your next one.

by Visitor stefuni
on ‎09-19-2014 07:48 AM

Hi,

 

Thanks for the blog/tutorial. Trying to follow the steps. OK so far but here I ran into a problem when trying to run the application. I got the message "MMU section translation fault".

 

A short search found that this happens when linux is already running when you wan t to download the code via the debugger:

 

http://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/SDK-debugs-causes-MMU-section-translation-fault/td-p/464158

 

The solution posted thers works fine. Reset the MicroZed and hit a key when uboot asks for it. The download woill be OK.

Labels
About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.