Difference between revisions of "Cross compile application for VIBEQ / ARCA-V2"
From Yantrr Wiki
(→Execute binary on ARCA-V2) |
(→Execute binary on ARCA-V2) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | =Setup ARM Cross-Compiler GCC= | |
Download and extract the ARM Cross compiler linaro gcc. From now on consider '''~/''' is the root directory of compilation setup. | Download and extract the ARM Cross compiler linaro gcc. From now on consider '''~/''' is the root directory of compilation setup. | ||
'''~/''' | '''~/''' | ||
Line 7: | Line 7: | ||
export CC=`pwd`/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- | export CC=`pwd`/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- | ||
− | + | =Test Cross-Compiler= | |
'''~/''' | '''~/''' | ||
Line 16: | Line 16: | ||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
− | + | =Cross-Compiling application= | |
* Create new program file of your application on Host PC | * Create new program file of your application on Host PC | ||
'''~/''' | '''~/''' | ||
Line 34: | Line 34: | ||
${CC}gcc hello_app.c -o hello_app_exe | ${CC}gcc hello_app.c -o hello_app_exe | ||
− | + | =Execute binary on ARCA-V2= | |
* Transfer final built binary to VIBEQ / ARCA-V2 | * Transfer final built binary to VIBEQ / ARCA-V2 | ||
The VIBEQ / ARCA-V2 has already support for SSH. The final build binary can be transferred from Host PC to VIBEQ / ARCA-V2 using scp command. | The VIBEQ / ARCA-V2 has already support for SSH. The final build binary can be transferred from Host PC to VIBEQ / ARCA-V2 using scp command. | ||
Line 83: | Line 83: | ||
'''-rwxr-xr-x 1 root root 9556 Mar 22 12:32 hello_app_exe''' | '''-rwxr-xr-x 1 root root 9556 Mar 22 12:32 hello_app_exe''' | ||
− | Run | + | Run your application |
root@arca-v2:~# ./hello_app_exe | root@arca-v2:~# ./hello_app_exe | ||
!!!...Hello World...!!! | !!!...Hello World...!!! |
Latest revision as of 03:44, 23 March 2022
Contents
Setup ARM Cross-Compiler GCC
Download and extract the ARM Cross compiler linaro gcc. From now on consider ~/ is the root directory of compilation setup.
~/
wget -c https://releases.linaro.org/components/toolchain/binaries/6.5-2018.12/arm-linux-gnueabihf/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf.tar.xz tar xf gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf.tar.xz export CC=`pwd`/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
Test Cross-Compiler
~/
${CC}gcc --version arm-linux-gnueabihf-gcc (Linaro GCC 6.5-2018.12) 6.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Cross-Compiling application
- Create new program file of your application on Host PC
~/
nano hello_app.c
- Write a content of your application
#include <stdio.h> int main(void) { printf("!!!...Hello World...!!!\n"); return 0; }
- Build the source using arm cross-compiler
${CC}gcc hello_app.c -o hello_app_exe
Execute binary on ARCA-V2
- Transfer final built binary to VIBEQ / ARCA-V2
The VIBEQ / ARCA-V2 has already support for SSH. The final build binary can be transferred from Host PC to VIBEQ / ARCA-V2 using scp command.
Connect to ARCA-V2 WiFi hotspot SSID: arca_wifi_ap and transfer the executable file from Host PC
~/
sudo scp hello_app_exe root@192.168.12.1:/root/
|
Please note fill your Host PC user password for sudo and VIBEQ / ARCA-V2 root user password for scp command. |
|
Here 192.168.12.1 is the IP address of ARCA-V2, change this IP address as per your setup. |
- Execute binary on VIBEQ / ARCA-V2
The executable binary file is already transferred and now login to ARCA-V2 using SSH client for executing it
ssh root@192.168.12.1 Debian GNU/Linux 10 Yantrr Electronic Systems Pvt. Ltd. VIBE2 Debian Buster Console Image 02-03-2022 Support/FAQ: http://support.zoho.com/portal/yantrr/home http://wiki.yantrr.com/Main_Page https://bbb.io/debian default username:password is [debian:temppwd] root@192.168.12.1's password: The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Mar 22 12:35:58 2022 from 192.168.12.11 root@arca-v2:~#
Check transferred built executable on VIBEQ / ARCA-V2
root@arca-v2:~# ls -l total 48 drwxr-xr-x 5 root root 4096 Mar 1 05:56 BoardTest drwxr-xr-x 3 root root 4096 Mar 4 11:14 bin -rw-r--r-- 1 root root 2971 Jan 1 2000 boot_run.log -rwxr-xr-x 1 root root 1387 Mar 4 09:10 boot_run.sh -rwxr-xr-x 1 root root 9556 Mar 22 12:32 hello_app_exe
Run your application
root@arca-v2:~# ./hello_app_exe !!!...Hello World...!!!