I am in the (very) early stages of developing a UAV flight controller on BeagleBone Black. I should mention that I'm pretty new when it comes to BBB, Linux and embedded systems. My academic focus was on management theory - this is my first attempt at practical implementation outside of Matlab Simulations. My current system is as follows:
Host-> Windows 8.1 x64 running Eclipse Luna (4.4.0)
Goal โ BeagleBone Black rev. B running Ubuntu 13.10
Target Information
root@arm :~
Gcc target version
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.8/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-10ubuntu9' --with-bugurl=file:///usr/shar e/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --w ith-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enabl e-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --ena ble-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr /lib/jvm/java-1.5.0-gcj-4.8-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf -- with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/ja va/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7- a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-lin ux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)
I installed the toolchain Sourcery Codebench Lite and use the GNU Make File . Ive set up the Eclipse environment in accordance with the training video provided by Michael Janz (link removed due to restriction - if the interested search is โCross-compiling and remote viewing for BeagleBoneโ on YouTube) with some minor tricks to run it on my system. These settings consisted mainly of removing the binding flags "--specs = rdimon.specs" and "-lrdimon", as I kept getting "no such file or directory" during compilation. With the removal of these two flags, the simple Hello ARM World program compiles without any problems.
After transferring the compiled ELF file to my BeagleBone, setting permissions and executable flags with:
chmod ugo-x Test6.elf
and running it through:
./Test6.elf
I get the following message:
root@arm :/home/ubuntu/RDKTestProgs
Initially, I thought that the mismatch between my 64-bit host system and the 32-bit GNU Make should not be a problem, but to resolve my doubts, I found a 64-bit GNU Make file (link removed due to restriction), although Im not confident in its integrity. In any case, both GNU Make files give the same result when trying to run a program on BBB.
After looking at a few posts, I found the readelf, strace, and strings tools that gave the following results.
Readelf:
root@arm :/home/ubuntu/RDKTestProgs
Strace:
root@arm :/home/ubuntu/RDKTestProgs
Strings:
root@arm :/home/ubuntu/RDKTestProgs
I searched through my BeagelBoneBlack for 4 shared library files specified from the "readelf" function, and found that they were indeed present. However, the problem is that some of these files are in the usr / lib / arm-linux-gnueabihf / directory, while others are in the / lib / arm -linux-gnueabihf # directory. To fix this, I created symbolic links to files not found in the / usr / lib / arm -linux-gnueabihf / directory. This has not yet resolved the issue. Therefore, I created symbolic links to files not found in the / lib / arm -linux-gnueabihf / directory. Again, no luck.
Is there a way to check which directory is used at runtime? What else might be missing from the Test6.elf file? Im at a loss at the moment. Any advice or recommendations would be greatly appreciated! Hooray!
PS I also managed to check GLIBCXX_3.4, GLIBC_2.4 and GCC_3.5, as shown below, but again some of them relate to files in / usr / lib / arm -linux-gnueabihf, others are in the / lib / arm directory -Linux-gnueabihf. Thanks again!
root@arm :/lib/arm-linux-gnueabihf
And finally, here is the "Hello ARM World" program
//============================================================================ // Name : main.cpp // Author : RDK // Version : // Copyright : Your copyright notice // Description : Hello World in C++ //============================================================================ #include <iostream> using namespace std; // // Print a greeting message on standard output and exit. // // On embedded platforms this might require semi-hosting or similar. // // For example, for toolchains derived from GNU Tools for Embedded, // to enable semi-hosting, the following was added to the linker: // // --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lc -lm -lrdimon -Wl,--end-group // // Adjust it for other toolchains. // int main() { cout << "Hello ARM World!" << endl; return 0; }