Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to write C application program for zedboard FPGA ?: (4 Items)
   
How to write C application program for zedboard FPGA ?  
Hi QNX,

             zedboard, QNX IDE 6.5SP1, BSP for zc702 (ported to zedboard), Xilinx vivado/sdk 2016.2

I have ported QXN zc702 BSP to zedboard, and BOOT.bin file contains my own FPGA bitstream generated by xilinx vivado 
design tool. 

Zedboard has both PS portion and PL portion, which are included in vivado sdk xparameters.h. It is noticed that /bsp-
xilinx-zynq7000-zc702_br-650_be-650sp1-src/install/usr/include/arm/xzynq.h only contains PS portion, while there is no 
PL definition.

I am able to write the c application program to communicate the PS devices, such as blinking LED 9, which connected to 
gpio/MIO pin 7 with below function,

#define ledpin 7

int main(int argc, char *argv[]) {

	/* Get the structure which contains the functions to control the GPIO */
	gpio_functions_t gpiofuncs;

	get_gpiofuncs (&gpiofuncs, sizeof(gpio_functions_t));

	/* Initialize the subsystem */
	gpiofuncs.init();

	/* Blink the LED DS23 */
	gpiofuncs.gpio_set_direction(ledpin, 1);
	gpiofuncs.gpio_set_output_enable(ledpin, 1);
	while(1){
		gpiofuncs.gpio_set_output(ledpin, 0);
		sleep(1);
		gpiofuncs.gpio_set_output(ledpin, 1);
		sleep(1);
	}
	/* Clean up the subsystem */
	gpiofuncs.fini();
}

However, I do not know how to program the PL/EMIO gpio pins which I defined in the bitstream. I did see the /dev/fpga 
entry, but not sure what its functionality.

# ls /dev
bpf            mem            ptyp7          tap2           tun0
bpf0           null           sem            tap3           tun1
clock          ocm            ser1           text           tun2
console        pipe           shmem          tty            tun3
crypto         profiler       slog           ttyp0          tymem
dbgmem         ptyp0          socket         ttyp1          xadc
fpga           ptyp1          stderr         ttyp2          zero
hd0            ptyp2          stdin          ttyp3
hd0t11         ptyp3          stdout         ttyp4
i2c1           ptyp4          tap            ttyp5
i2c2           ptyp5          tap0           ttyp6
io-usb-dcd     ptyp6          tap1           ttyp7

Please advise, thanks in advance

Mike
Re: How to write C application program for zedboard FPGA ?  
any suggestions?
RE: How to write C application program for zedboard FPGA ?  
The BSP documentation for this board describes how to flash the FPGA. Do you have this document?

--Elad
________________________________________
From: mike scott [community-noreply@qnx.com]
Sent: March-02-18 2:28 AM
To: ostech-core_os
Subject: Re: How to write C application program for zedboard FPGA ?

any suggestions?



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post118639
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
Re: RE: How to write C application program for zedboard FPGA ?  
guess I figured it out, thanks for the help ~~