Crosscompiling/Debugging on Odroid-xu4

Test and fix the Kernel 4.14 features

Moderators: mdrjr, odroid

Crosscompiling/Debugging on Odroid-xu4

Unread postby tc.th3.bl4cksm1th » Wed Sep 05, 2018 7:12 pm

Hi i havent figured out if thatst he right place to come to yet but im gona try it :D

Im trying to setup a crosscompiling environment.

Host machine is a windows system wich has a vm running on with Ubuntu 16.04 lts 64bit.
Im writing c++ code and planing to work with opencv 3.4, using the Eclipse Oxygen 3 GUI.
My code is not nessesary complet yet but it is runing already to some degree. Now i need to know if its worth pursuing the direction i chose to develop my code or if it fails to run on the target hardware eventualy due to its limitet computational capacity.

The hardware we will try to run the code is aimed about somewhere in the range of an odroid-xu4 and IMX6 in terms of computational performance.
Now that i have my hands on an odroid-xu4 iv been trying to setup a development environment to test the code this hardware.
But i fail miserably to setup a crosscompiling toolchain for it.
Iv been trying to setup something similar like in that video https://www.youtube.com/watch?v=T9yFyWsyyGk
but unfortunatly it does not work i can compile the code on my 64bit system for arm architecture on my vm and copy it over after compilation through an ssh connection to the odroid but i can not execute the file on the odroid even tho the architecture is correct.

Has some1 setup a similar development environment and can point me a direction to a guide or something like that that is working cuz my current aproach seams to not working out sadly.
tc.th3.bl4cksm1th
 
Posts: 3
Joined: Fri Aug 17, 2018 7:09 pm
languages_spoken: english
ODROIDs: odroid-ux4

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby moon.linux » Thu Sep 06, 2018 12:30 am

I have seen this youtube video on cross compilation on x86 machine and then use the binary on target board.
But I feel Odroid XU4 is much powerful to handle eclipse to compile and run native programs unlike Raspberry pi/Beagle boards.

We do support cross compilation for the kernel
Code: Select all
https://wiki.odroid.com/odroid-xu4/software/building_kernel?s[]=cross#cross-build

You can uses the steps to setup the tool-chain for cross compilation and then compile the source code.
after that you can copy the binary on target machine.
Last edited by moon.linux on Thu Sep 06, 2018 2:22 am, edited 1 time in total.
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby tobetter » Thu Sep 06, 2018 1:01 am

tc.th3.bl4cksm1th wrote:but unfortunatly it does not work i can compile the code on my 64bit system for arm architecture on my vm and copy it over after compilation through an ssh connection to the odroid but i can not execute the file on the odroid even tho the architecture is correct.

I'm wondering what's the error you faced when you run your compiled binary on ODROID-XU4.
Also, if you only need to compile your own code which is not so huge, I guess you can compile it ODROID-XU4 itself like what you used to do on your Linux box. For debugging, you also can consider to run remote debugging with Eclipse.
User avatar
tobetter
 
Posts: 2464
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby tc.th3.bl4cksm1th » Thu Sep 06, 2018 7:48 pm

this is the error im stuck with at the moment: https://ibb.co/e9MJaK

my configuration is looking like this:
https://ibb.co/bCC8aK
https://ibb.co/fmFi9e
https://ibb.co/jDEh2z

im prety sure the file is compiled correctly for the arm architecture as u can see here my testcode and the execution of the file through ssh comand line on the target system: https://ibb.co/fhymUe


Edit: pictures: https://imgur.com/a/ABoPpyF
i hope this one works
Last edited by tc.th3.bl4cksm1th on Thu Sep 06, 2018 10:53 pm, edited 1 time in total.
tc.th3.bl4cksm1th
 
Posts: 3
Joined: Fri Aug 17, 2018 7:09 pm
languages_spoken: english
ODROIDs: odroid-ux4

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby tobetter » Thu Sep 06, 2018 10:28 pm

tc.th3.bl4cksm1th wrote:this is the error im stuck with at the moment: https://ibb.co/e9MJaK

my configuration is looking like this:
https://ibb.co/bCC8aK
https://ibb.co/fmFi9e
https://ibb.co/jDEh2z

im prety sure the file is compiled correctly for the arm architecture as u can see here my testcode and the execution of the file through ssh comand line on the target system: https://ibb.co/fhymUe

For some reason, I am not able to see the images from your links. They just come and gone quickly whenever the page is refreshed. Anyway, what I've seen from the first image is that ARMO which is the file copied into ODROID is not existed according to the pop-up box. So my guess is that Eclipse set up is not correct to access the path /home/odroid/Sensor1/test or ARMO is copied as test by mistake? If you want to verify whether the code is compiled to run ODROID-XU4, log into it and run file command to your binary. If your binary is fine, it will show you binary information with armhf other than aarch64. Even you can run the binary from ODROID-XU4 directly. If everything is ok till here, the problem is only Eclipse setup to access the path to run your binary.
User avatar
tobetter
 
Posts: 2464
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby tc.th3.bl4cksm1th » Thu Sep 06, 2018 11:00 pm

i can run the code when im logged in on the odroid or through ssh login

odroid@odroid:~/Sensor1/test$ ll ARMO
-rwxrwxr-x 1 odroid odroid 8840 Sep 6 10:09 ARMO*
odroid@odroid:~/Sensor1/test$ file ARMO
ARMO: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=54b02902d47533ff6bfd2a166b711d07aafca825, not stripped
odroid@odroid:~/Sensor1/test$ ls
ARMO
odroid@odroid:~/Sensor1/test$ ./ARMO
1!!!Hello World from ARM arhitecture!!!
odroid@odroid:~/Sensor1/test$


But somehow eclips does not exactly know where to look for the executable. Look at 4th picture i think i messed it up somewhere there but i dont know exactly what:
https://imgur.com/a/ABoPpyF
tc.th3.bl4cksm1th
 
Posts: 3
Joined: Fri Aug 17, 2018 7:09 pm
languages_spoken: english
ODROIDs: odroid-ux4

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby tobetter » Thu Sep 06, 2018 11:37 pm

tc.th3.bl4cksm1th wrote:i can run the code when im logged in on the odroid or through ssh login

odroid@odroid:~/Sensor1/test$ ll ARMO
-rwxrwxr-x 1 odroid odroid 8840 Sep 6 10:09 ARMO*
odroid@odroid:~/Sensor1/test$ file ARMO
ARMO: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=54b02902d47533ff6bfd2a166b711d07aafca825, not stripped
odroid@odroid:~/Sensor1/test$ ls
ARMO
odroid@odroid:~/Sensor1/test$ ./ARMO
1!!!Hello World from ARM arhitecture!!!
odroid@odroid:~/Sensor1/test$


But somehow eclips does not exactly know where to look for the executable. Look at 4th picture i think i messed it up somewhere there but i dont know exactly what:
https://imgur.com/a/ABoPpyF

I think everything else is ok except Eclipse setup. If you have selected the binary ARMO from "Browse" in setup dialog it should work. Just curious is that correct ARMO in "C/C++ Application"?
User avatar
tobetter
 
Posts: 2464
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Crosscompiling/Debugging on Odroid-xu4

Unread postby moon.linux » Thu Sep 06, 2018 11:49 pm

How about need to take wireshark capture to understand the protocol need to communicate with the board x86 (eclipse) and Odrid-XU4.

As per my understanding is that you are cross compiling the code on X86 machine on Eclipse and then trying to connect to Odroid XU4 via remote connection to execute the binary ?
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english


Return to Linux Kernel 4.14 Debugging Party

Who is online

Users browsing this forum: No registered users and 3 guests