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!

cancel
Showing results for 
Search instead for 
Did you mean: 
1,077 Views
Registered: ‎12-18-2017

./app: line 1: syntax error: unexpected word (expecting ")")

Jump to solution

Hello,

I have designed an Enterprise switch using Vivado 2017, generated the boot.bin files using xilinx SDK 2017. I have booted the xilinx zynq 7000 board via SD card with the required files i.e. BOOT.bin, devicetree.dtb, uImage and init.sh. I can see all the eth0-4 interfaces using ifconfig, and i can ping to the computers on the LAN of my lab and i can tcpdump and tcpreplay the .pcap files too. I have cross compiled an "app" on my x86 64bit ubuntu machine for the xilinx zynq cortex a9 32 bit arm processor, to download the flow entries into the flow tables as follows:

 

arm-linux-gnueabihf-gcc -g ./arm/TCAM.c ./arm/ureg.c ./pasive_tcam-api.c -o app

The files 'app' and 'lookup.tbl' are copied to ROOTFS/Systemfiles of the SD Card and executed as follows:

 

 

zynq>./app lookup.tbl

but when i execute the above command, it gives me errors. Errors are as follows.

 

Without sudo it gives me error of:

-/bin/ash: ./app: not found


with "sh ./app lookup.tbl" it gives following error:

 

 

./app: line 1: syntax error: expecting word (expected")")

Note that i can use the same 'app' to downlaod the flow entries in to the flow tables successfully if I boot the FPGA via another SD Card, copying the same all files to it. I think the difference between the two SD Cards is that: "sudo" is not there on the Error giving sd card while on the successful sd card the "sudo" is working and i can "sudo ./app lookup.tbl".

But when i use the following command to see the users on the zynq machine, I get the following user:

 

 

zynq> awk -F':' '{ print $1}' /etc/passwd
zynq> root

 

I think i need to sudo the "./app lookup.tbl" on the error giving sd card too. I can 'su' but not 'sudo' on my zynq machine. I don't know that can i install "sudo" offline on my board? And i am not very good in these sudo kind of things.

I have used the below command to give all permissions to app too.

zynq>chmod 777 app

When used 'pwd', it gives:

zynq> pwd
zynq> /

Also pls note that I need to do my project on this error giving sd card due to some other issues. So, can anybody tell me where could be the problem to get rid of the above errors while executing "./app lookup.tbl".

0 Kudos
1 Solution

Accepted Solutions
1,022 Views
Registered: ‎12-18-2017

Re: ./app: line 1: syntax error: unexpected word (expecting ")")

Jump to solution

I have solved the problem, and in case if someone else faces this problem, i post the solution here:

I was using the right compiler to generate the 'app' for the working sd card which is hard-float platform on which i could successfully downloaded the flow entries in to the TCAM tables, i.e. 

arm-linux-gnueabihf-gcc

and i was using the same cross compiler to generate the 'app' for the error-giving sd card too, that was causing the panic. 

So, i used the right cross compiler for the other sd card, i,e,

arm-linux-gnueabi-gcc

and it successfully downlaoded the flow entries into the TCAM flow tables.

Whenever cross compiling, make sure to use the right compiler for your platform, because cross compiling causes most of the errors.

Thanks

View solution in original post

0 Kudos
1 Reply
1,023 Views
Registered: ‎12-18-2017

Re: ./app: line 1: syntax error: unexpected word (expecting ")")

Jump to solution

I have solved the problem, and in case if someone else faces this problem, i post the solution here:

I was using the right compiler to generate the 'app' for the working sd card which is hard-float platform on which i could successfully downloaded the flow entries in to the TCAM tables, i.e. 

arm-linux-gnueabihf-gcc

and i was using the same cross compiler to generate the 'app' for the error-giving sd card too, that was causing the panic. 

So, i used the right cross compiler for the other sd card, i,e,

arm-linux-gnueabi-gcc

and it successfully downlaoded the flow entries into the TCAM flow tables.

Whenever cross compiling, make sure to use the right compiler for your platform, because cross compiling causes most of the errors.

Thanks

View solution in original post

0 Kudos