Sorry, you need to enable JavaScript to visit this website.

LED application on Zed board

Unsolved
10 posts / 0 new
gigin's picture
gigin
Junior(0)
LED application on Zed board

Hi,

I am working on Zed board. I would like to work on the eclipse based SDK to dump the basic bare-metal applications onto Zed the board. I am able to put the hello world application through JTAG, where the "Hello World" text gets printed through the serial port. This is the process I follow to get the hello world application deployed on the target:
1. Import the system.xml file into the eclipse based Xilinx SDK IDE.
2. Create a new application project, with support of an existing standalone bsp.
3. The application project is created with a hello world template.
4. Now, compile and Run the application project onto the target, with the target configured in JTAG mode.
With these steps, the "Hello World" text gets printed on the serial port of the target.

Following the above steps, I am not able to work on the LED application. It seems like there are some hardware initialization missing in the process, which is the reason why the application fails. How do I put the hardware configuration file on the target board ? Do I need to use Impact tool for making the basic LED example work on the Zed platform.
I am pretty new to the FPGA part of programming, but fine with ARM side bare-metal applications.

Thank You

TroutChaser's picture
TroutChaser
Moderator(18)
You will need to create and export a bitstream

When you imported the system.xml file you must have imported the ps7_init.tcl file as well, which initialized the PS (Processor Section) of the Zynq device when run in the SDK. If your LED had been connected to an IO on the PS section of the device it would have worked as well. To use any of the portion of the ZedBoard connected to the PL (Programmable Logic) portion of the Zynq device you will need to first implement a design in either the Xilinx Vivado or ISE/PlanAhead tool suites. I would recommend using the Vivado tools as that is where all future development and examples will be done.
Once you have implemented a design in the Xilinx tools that includes the Zynq PS and PL sections you will generate a bitstream and then 'export' this bitstream to the SDK. Then, within the SDK, you can load the FPGA bitstream and debug your software application.
 
The Zynq Concepts, Tools and Techniques or one of the other tutorials can walk you through the process:
 
http://www.zedboard.org/design/1521/11
 
-Gary
 

hsaeed's picture
hsaeed
Junior(0)
led flashing

I have a very basic question.
I am searching for some sample xilinx SDK code.
e.g. the code should flash leds on the ZedBoard every 5 sec or so...
Is there any one who can guide me?
Thanks in advance.

Regards
Hamid

TroutChaser's picture
TroutChaser
Moderator(18)
There is example code in SDK

Once you have exported your Zynq design that includes GPIO that is connected to your LEDs to SDK open up the system.mss file (under your bsp on the left in the Project Explorer pane if it is not already open). Scroll down to the 'Peripheral Drivers' section and click on the 'Examples' next to the GPIO you are using to drive your LEDs (either axi_gpio or ps7_gpio). The xgpio_example.c source code shows you how to blink an LED.
 
-Gary

hsaeed's picture
hsaeed
Junior(0)
Your suggestion was perfect

Hello thanks Gary,
The code you mentioned is working.
I made a slight change in the code.
Instead of using
Status = XGpio_Initialize(&Gpio, GPIO_EXAMPLE_DEVICE_ID);
i used
Status = XGpio_Initialize(&Gpio, 0);

I don't exactly know what was the problem but this change worked.

:)

Regards
Hamid

TroutChaser's picture
TroutChaser
Moderator(18)
Look in xparameters.h

Glad that worked for you. The GPIO_EXAMPLE_DEVICE_ID declaration is just a place holder for your real device declaration. If you will look in xparameters.h in the 'include' directory, under 'ps7_cortexa9_0 under the BSP in the Project Explorer pane on the left, you will find the declarations for your project. Probably something like 'XPAR_AXI_GPIO_0_DEVICE_ID'.
 
-Gary

windvalley's picture
windvalley
Junior(0)
Hi,

Hi,

I have followed the "Hello World" tutorial by Zynq Geek, and that worked fine. However I can't get the blinking LEDs example to work. It seems to hang at the line:
"XGpio_SetDataDirection(&Gpio, LED_CHANNEL, ~LED);"

Using ZedBoard with ISE suite 14.7 on Win7-64

Any tips would be greatly appreciated!

kandans's picture
kandans
Junior(0)
XGpio_SetDataDirection issue

Hi,
Me too facing the same issue . The code is hanging at XGpio_SetDataDirection(&Gpio, LED_CHANNEL, ~LED);"

How did you solved?

Regards
Sujesh

TroutChaser's picture
TroutChaser
Moderator(18)
Move to Vivado

Let me suggest that you move to the current Vivado tool suite. You will find more current examples and support for the Zynq device.
 
-Gary

kandans's picture
kandans
Junior(0)
led_control example issue solved

Hi, Just u need to add the ps7_post_config after ps7_init. It solved my issue in zedboard rev D.

Sujesh