Page 1 of 1

error in using application

Posted: Tue Oct 28, 2014 4:04 pm
by Pierre A
hi !

I need to use the UART pins on red pitaya E2 connector, so I made a C code to read/write some data on UART pins, I cross compile this code and copy the executable on /opt/bin/ directory, but when I want to use it with a konsole on linux, I read this message from red pitaya :
/opt/bin/serial : line 1: syntax error: unexpected "("
The thing is, with exactly the same process I try to use the helloworld application and I receive the same error from red pitaya, but I'm sure there is no "(" error in this code...

Code: Select all

 #include <stdio.h>

int main()
{
     printf("helloworld \n");
}
Somebody already met this problem and know how to go through ?

thanks in advance :)

Re: error in using application

Posted: Tue Oct 28, 2014 4:23 pm
by Kev' Ttn
Hi Pierre,

Did you compile with a terminal on your PC ? Did you use the following command ?

Code: Select all

make CROSS_COMPILE=arm-linux-gnueabi- clean all 
Because your error is really weird...

Re: error in using application

Posted: Tue Oct 28, 2014 5:15 pm
by Pierre A
yes I use this command to compile, it's why I don't understand where I do something wrong ..

Re: error in using application

Posted: Tue Oct 28, 2014 6:53 pm
by Nils Roos
Could you attach your binary, so that others (eg me) can take a look at it ?
Or take a look at it yourself in a hex editor, valid executables have the values 0x7F 0x45 0x4C 0x46 (".ELF") in the first four bytes. If that is not the case with yours, you are probably using the wrong toolchain or target.