Reputation: 51
I am using yocto project.
I have a sama5d27 som1 ek1 board. I made it bootable from SD card. Now I want to cross compile a Helloworld.c
file and execute it on sama5 board.
The problem is: how send the .bin compiled file from my host machine to sama5 board and execute it ?
Thank you.
Upvotes: 2
Views: 275
Reputation: 406
You can also create a nfs server on your host PC (really easy for example on Ubuntu) and install nfs client in your Yocto image which is already installed in the standard images from the meta-atmel (atmel-demo-image, etc).
Once running, you can mount the nfs volume inside your target with the following command:
$ sudo mount -t nfs <host ip address>:<host mounting point> /mnt
It creates a bridge between your target and your PC which is really useful for dev. It's then really easy to work, compile, recompile on the host and to have the result directly inside the target as long as the result of the compilation is directly inside the exported directory of your host.
P.S.: You need to allow your target (IP range is possible) in the file /etc/exports of your host system as probably explained in the nfs server setup of your host distro.
Edit: Concerning the way how to execute the binary, you need first of all to make it executable if not already.
$ chmod +x <the binary>
You can know if the file is executable using the command ls with -la args:
$ ls -la
total 13776
drwxrwxrwx 1 user user 4096 May 11 16:34 .
drwxr-xr-x 1 user user 4096 May 11 16:34 ..
-rw-rw-rw- 1 user user 14103552 May 11 16:35 binary.bin <- not executable
$ chmod +x binary.bin
$ ls -la
total 13776
drwxrwxrwx 1 user user 4096 May 11 16:34 .
drwxr-xr-x 1 user user 4096 May 11 16:34 ..
-rwxrwxrwx 1 user user 14103552 May 11 16:35 binary.bin <- executable
Then run the binary:
$ ./binary.bin
hello world
Upvotes: 3