cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
5,361 Views
Registered: ‎09-28-2016

zc706 led blink example?

HI, all

my board is zc706, SDK2015.4.  there are four user leds on the board, and I want to blink one of it.

I use the source file SDK/2015.4/data/embeddedsw/XilinxProcessorIPLib/drivers/gpio_v4_0/examples/xgpio_example.c, and build a standalone project include xgpio_example.c and other files. but when I compile it , there is an error:

error: 'XPAR_LEDS_POSITIONS_DEVICE_ID' undeclared (first use in this function)
 #define GPIO_EXAMPLE_DEVICE_ID  XPAR_LEDS_POSITIONS_DEVICE_ID

 

I search the whole SDK directory, unfortunately, can't find any define about XPAR_LEDS_POSITIONS_DEVICE_ID.

 

who can help me please ?

 

 

Tom

0 Kudos
4 Replies
Highlighted
Teacher
Teacher
5,349 Views
Registered: ‎03-31-2012

@atower I haven't done this myself in quite a while but I think these headers come through the HDF file you generate when you implement your design with the LEDs in them (or the GPIO driving LEDs). You push the HDF file through the sdk to generate the BSP and the application and the BSP has the necessary hardware dependent headers in it one of which is the file with the definition you need.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
5,322 Views
Registered: ‎08-01-2008

check this example
https://www.youtube.com/watch?v=8i8GLF-Md3U

all LEDs on the zc706 are connected to PL pins. So, at a bare minimum, you need a bitstream that routes those pins to the PS GPIO on the EMIO interface.

Once there you should use the gpio-led driver to control the LEDs.

http://forums.xilinx.com/t5/Embedded-Linux/Blink-LEDs-in-Linux-on-Zynq-through-dev-mem/m-p/534365/highlight/true#M10996

http://www.wiki.xilinx.com/Linux+GPIO+Driver#Linux%20Kernel%20Drivers-LEDS-GPIO%20Driver

For board debug you can refer this ARs
https://www.xilinx.com/support/answers/54013.html

Please check if below discussion helps

http://forums.xilinx.com/t5/Embedded-Linux/How-do-I-access-GPIO-on-ZedBoard-using-the-latest-Petalinux/td-p/365741



Also this AR

http://www.xilinx.com/support/answers/51786.html

Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
5,251 Views
Registered: ‎07-01-2010

@atower

 

"XPAR_LEDS_POSITIONS_DEVICE_ID" in xgpio_example.c a reference and you have to change the name based on the hardware instances that were created.


Example:
#define GPIO_EXAMPLE_DEVICE_ID XPAR_AXI_GPIO_0_DEVICE_ID

 

Refer to the xparameters.h file located in the BSP generated (ex:project_1.sdk\standalone_bsp_0\ps7_cortexa9_0\include) for device_ID of your GPIO peripheral.

 

Regards,

Achutha

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
5,228 Views
Registered: ‎09-28-2016

Hi,Achutha

 

thanks for your reply.

 

 

I searched the file xparameters.h, it jut define the two below:

 

/* Definitions for peripheral PS7_GPIO_0 */
#define XPAR_PS7_GPIO_0_DEVICE_ID 0
#define XPAR_PS7_GPIO_0_BASEADDR 0xE000A000

 

but in the gpio example, it need the fefine these as below:

#define GPIO_REG_BASEADDR    XPAR_LEDS_POSITIONS_BASEADDR

#define GPIO_EXAMPLE_DEVICE_ID  XPAR_LEDS_POSITIONS_DEVICE_ID

 

so can I define them by myself in my application as below:

#define      XPAR_LEDS_POSITIONS_BASEADDR      XPAR_PS7_GPIO_0_BASEADDR

#define      XPAR_LEDS_POSITIONS_DEVICE_ID      XPAR_PS7_GPIO_0_DEVICE_ID

 

 

 

Tom

 

0 Kudos