Page 1 of 1

Executing cross compiled c on the Red Pitaya

Posted: Wed Jul 08, 2015 1:36 pm
by Mark Corrigan
I wrote a basic hello world c program for the Red Pitaya - just as an initial proof it would work.

The program;

Code: Select all


#include <stdio.h>

main()
{
    printf("hello red pitaya\r\n");
}

Can't be much wrong with that?!

After that I compiled it with the latest arm cross compiler I could find - arm-linux-gnueabi-gcc;

Code: Select all

arm-linux-gnueabi-gcc hello_red_pitaya.c -o hello_red_pitaya
After this I'm scp-ing it across to the Red Pitaya from my Linux box;

Code: Select all

scp hello_red_pitaya root@192.168.1.100:/root


Then I ssh into the red pitaya and try to execute the compiled file;

Code: Select all

./hello_red_pitaya
However, I'm met with the error;

Code: Select all

sh ./hello_red_pitaya: not found
Does it think it's supposed to be a shell script of something?

Thanks!

Re: Executing cross compiled c on the Red Pitaya

Posted: Wed Jul 08, 2015 1:48 pm
by Arnold
does the operating system use soft-float or hard-float?

how to figure out:
http://raspberrypi.stackexchange.com/qu ... -of-debian

soft-float: arm-linux-gnueabi-gcc
hard-float: arm-linux-gnueabihf-gcc

Re: Executing cross compiled c on the Red Pitaya

Posted: Wed Jul 08, 2015 1:54 pm
by Mark Corrigan
That was it thank you! I was compiling for hard float - turns out it wants soft float.

Could you kindly explain the difference if you have time?

Re: Executing cross compiled c on the Red Pitaya

Posted: Wed Jul 08, 2015 1:55 pm
by Arnold