cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jmgrn
Adventurer
Adventurer
9,770 Views
Registered: ‎08-20-2014

About the Linux application development on ZC706

Currently, I am able to boot the linux system running on the ZC706. However, when we tried to build an application and run it on the target board using SDK, we came across some problems:

 

(1) Right-click linux_cdma_app and select Run As > Run Configurations to open the Run Configurations wizard.

(2) Right-click Xilinx C/C++ application (System Debugger) and select New.

(3) In the Connection tab, click New to open the New Connection wizard. In the New Target Connection screen, apply the settings below.

Linux TCF Agent.png

However, we can not see the option "Linux TCF Agent" for "Type". In the contrary, we only see "Hardware server" as shown below.

TCF_agent_Problem.png

 

Then, in the following steps, we got the following error:

TCF_agent_Problem2.png

Could anybody give me give ideas what is wrong? Any suggestions will be appreciated.

Thanks in advance :)

 

0 Kudos
7 Replies
muzaffer
Teacher
Teacher
9,754 Views
Registered: ‎03-31-2012

did you try following the instructions on the error dialog? ie:

on a command line (from a shell) type:
hw_server -s tcp::1534
and press enter.
- 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
Anonymous
Not applicable
9,745 Views

See the attached Tutorial

0 Kudos
jmgrn
Adventurer
Adventurer
9,729 Views
Registered: ‎08-20-2014

Thank you for your reply.
I tried the instructions so the "Hardware Server Not Running" notice disappeared, but still no apps or executable files were observed under the /tmp folder. Therefore, we believe it might be some other problems.
In fact, the "image.ub" and "boot.BIN" were downloaded from Xilinx website, therefore, they were not created by ourselves. Is it possible that those files do not have TCF agent integrated at all?
0 Kudos
jmgrn
Adventurer
Adventurer
9,726 Views
Registered: ‎08-20-2014

Thank you for your reply.

In fact, we used the image.ub and boot.BIN files downloaded from Xilinx website (TRD) to boot our linux system. 

So we did not build these files by ourselves, and all our operations were performed under Windows 7.

 

Could you please give us some suggestions? What we want to do is just (1) Have a linux system running on the zc706 board; (2) Have some simple C programs running on this linux; (3) If possbile, we want to attach a multiplier as a custom IP to the AXI bus, and use the C programs to access this multiplier.

 

Can these be achieved by only vivado 2015.1 running on Windows7? Is it necessary that we have a Vivado or Petalinux installed on a Linux OS? According to this video http://www.xilinx.com/training/zynq/how-to-create-linux-application-using-xilinx-sdk.htm, that guy only do experiement under Windows OS. 

0 Kudos
rickys
Xilinx Employee
Xilinx Employee
9,703 Views
Registered: ‎08-01-2007

To accomplish your job requirement 1,2,3, some ready-made Linux images for ZC706 can be used. For example, http://www.wiki.xilinx.com/Zynq+2015.2+Release

1) Copy the related files to SD card, Linux run on ZC706
2) Use SDK to create some apps for Linux. After the elf is compiled, you can also copy it to SD card and go to /mnt to run it.
3) Generate your bit file with custom IP. Remember the custom IP address. Configure PL in Linux (cat xx.bit > /dev/xdevcfg). Control your custom IP's register by mmap() functions or devmem tool in Xilinx rootfs.
jmgrn
Adventurer
Adventurer
9,682 Views
Registered: ‎08-20-2014

@rickys

Thanks for your instructions.

I have successfully performed the experiments in (1) and (2). But I still have some questions for (3).

 

For (3), we use the same Linux OS and Boot.Bin for (1) and (2). However, we created our own multiplier IP and packaged it and attach it to AXI bus.  We directly wrote a C program with /dev/mem and mmap(), because we already recorded the physical address of our device.

 

After compiling our C program with Xilinx SDK, we copied the corresponding  .elf file and .bit file into SD card.

After we mount the SD card, we performed "cat *.bit > /dev/xdesg" and got no errors. Then we performed "./Ourprogram", but stuck after the mmap() function. I have attached our codes here:

 

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>

#define PHY_ADDR 0x43C00000

int main()
{
	int fd;
	unsigned mul_addr = PHY_ADDR;
	short a,b;
	a = 2;
	b = 33;
        unsigned int value = 0;

	unsigned page_addr, page_offset;
	void *ptr;
	unsigned page_size=sysconf(_SC_PAGESIZE); //?

	printf("MUL access through /dev/mem with page_size %d \n", page_size);

	if (mul_addr == 0)
	{
		printf("MUL physical address is required.\n");
		return -1;
	}

	/* Open /dev/mem file */
	fd = open ("/dev/mem", O_RDWR);
	if (fd < 1) {
		perror(" /dev/mem open failed ");
		return -1;
	}

	/* mmap the device into memory */
	page_addr = (mul_addr & (~(page_size-1)));
	page_offset = mul_addr - page_addr;
	ptr = mmap(NULL, page_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, page_addr);

	printf("SW test <%d x %d = %d>\n", a,b, a*b);

	/* Write value to the device register */
	*((unsigned int*)(ptr + page_offset+0)) = (a<<16)+b;

    /* Read value from the device register */
	value = *((unsigned int *)(ptr + page_offset+4));
	printf("Multiplier Output: %d\n",value);
	munmap(ptr, page_size);

	return 0;
}

But the results we got is like:

 

MUL access through /dev/mem with page_size 4096

SW test <2 x 33 

which means that the instruction

printf("SW test <%d x %d = %d>\n", a,b, a*b);

is not executed successfully.  Therefore, we guess there might be something wrong with mmap() function.

Then we tried to run the program with "sudo", as expected, "sudo" does not exist in this linux OS. Then we tried "su root ./Ourprogram"  and got the following error

line 1: Syntax error: unexpected word (expecting ")")

The image.ub was download from Xilinx website. (Linux Xilinx-ZC702-2015_2   3.19.0-xilinx)

The evaluation board we are using is ZC706.

 

Could you please tell me what the program might be? Thanks

0 Kudos
jmgrn
Adventurer
Adventurer
9,672 Views
Registered: ‎08-20-2014

We tried another Linux OS image without any other changes. Now it works well : )

Still trying to figure out the mainstream design flow for this type of project.  Can anyone give some suggestions?

Should we use some well-prepared Linux images downloaded online, or use Petalinux to compile one for ourselves? Which do you experts prefer?

0 Kudos