When I followed the steps for the cross compile the hello_board c code on this link https://developer.ruggedboard.com/g5-system-development-guide/host-setup and tried to execute the hello_board on the rugged board then it gives below error.
root@rugged-board-a5d2x-sd1:~# uname -a
Linux rugged-board-a5d2x-sd1 4.9.151-linux4sam_5.8+-04823-gab4590e #1 Tue Mar 31 08:57:52 UTC 2020 armv7l GNU/Linux
root@rugged-board-a5d2x-sd1:~# ./hello
-sh: ./hello: not found
root@rugged-board-a5d2x-sd1:~#
Logs on Host system:
upesh@upesh-Lenovo-Z50-70:~/c_project$ cat hello.c
#include <stdio.h>
int main()
{
printf("Hello board!!\n");
return 0;
}
upesh@upesh-Lenovo-Z50-70:~/c_project$ arm-linux-gnueabihf-gcc hello.c -o hello_board
upesh@upesh-Lenovo-Z50-70:~/c_project$ ls
gpio_toggle.c hello_board hello.c test1
upesh@upesh-Lenovo-Z50-70:~/c_project$ sudo cp hello_board /var/lib/tftpboot/
File details:
upesh@upesh-Lenovo-Z50-70:~/c_project$ readelf -h hello_board
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x3fd
Start of program headers: 52 (bytes into file)
Start of section headers: 6996 (bytes into file)
Flags: 0x5000400, Version5 EABI, hard-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 9
Size of section headers: 40 (bytes)
Number of section headers: 29
Section header string table index: 28
upesh@upesh-Lenovo-Z50-70:~/c_project$
Logs on Rugged board:
root@rugged-board-a5d2x-sd1:~# tftp -r hello_board -g 192.168.1.101
root@rugged-board-a5d2x-sd1:~# ls
hello_board
root@rugged-board-a5d2x-sd1:~# chmod +x hello_board
root@rugged-board-a5d2x-sd1:~# ls
hello_board
root@rugged-board-a5d2x-sd1:~# ls -ll
-rwxr-xr-x 1 root root 8156 Jan 1 01:04 hello_board
root@rugged-board-a5d2x-sd1:~# ./hello_board
-sh: ./hello_board: not found
root@rugged-board-a5d2x-sd1:~#
Please help to provide the solution for it.
hello,
Thank you so much for sharing this helpful information, it helped me alot
Thanks and regards.:)
Thanks for the help eveThank you so much for this. I was into this issue and tired to tinker around to check if its possible but couldnt get it done. Now that i have seen the way you did it, thanks guys
with
regardsryone!
Thank you. I understand my mistake. File was not copied properly due to Network unreachable.
From below log, got to know that your ethernet is not up and hello binary is not copying to board.
root@rugged-board-a5d2x-sd1:~# tftp -r hello -g 192.168.1.101
tftp: sendto: Network unreachable
to make ethernet up use below command udhcpc -i eth0
644 571 211
OK
Please install anydesk and share the details.
Ok. I have team viewer. Is it fine?
once try to cross compile it again and check, if its not working. please share anydesk.
upesh@upesh-Lenovo-Z50-70:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
Your ubuntu os version?
upesh@upesh-Lenovo-Z50-70:/home/work$ sudo apt-get install lib32ncurses5-dev lib32readline6-dev lib32z1-de
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'lib32readline-dev' instead of 'lib32readline6-dev'
E: Unable to locate package lib32z1-de
sudo apt-get install lib32ncurses5 lib32z1
sudo apt-get install lib32ncurses5-dev lib32readline6-dev lib32z1-de
install above commands and try to cross compile again.
PFA.
Getting issue while installing if_machine....
have you installed all packages with script files from below link? https://developer.ruggedboard.com/g5-system-development-guide/host-setup
Thanks for quick support.
I like to run hello.c program in rugged board.
I try to cross compile it in Host PC and try to build in Rugged board but I am not getting expected output.
Please remove $ and run as below. . /opt/poky-tiny/2.5.2/environment-setup-cortexa5hf-neon-poky-linux-musleabi
Once try to run as below ./poky-tiny***
Please follow below link to cross compile the application https://developer.ruggedboard.com/g5-system-development-guide/download-the-toolchain-for-rugged-board-a5d2x