HelloBone

Cross-Compile and Remote Deploy from Windows for BeagleBone using Eclipse and a Linaro-gcc Toolchain.

This article explains in detail how to set up a C/C++ Toolchain with a gcc Cross Compiler and the Eclipse IDE in Windows 7 and shows how both are used with a BeagleBone board.

There is a similar project from Michael Leonard available and also a video tutorial from Derek Molloy but instead of using a virtual machine with Linux this tutorial shows how to set up a toolchain on Windows 7 “native”. I assume Windows XP and Windows 8 could be used as well. (I just didn’t check).

I couldn’t find a good step-by-step introduction for this topic therefore I decided to contribute this page to the BeagleBone community. Besides that I’m pretty sure everything I show here is not related to the BeagleBone only and it would work on Raspberry Pi or other embedded Linux platforms in the same way.

Step 1: Set up the cross compiler

A good source for cross compiler toolchains is linaro.org . The one I’m using has to have the Linux support build in so I decided to download this file:

gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_win32.zip

Just download and extract the zip file to your local harddrive. I recommend using a short path without spaces to ease up the build configuration later on. Therefore my choice is to put the cross compiler in my Harddrive’s root directory like:

C:\gcc-linaro

Step 2: Set up Eclipse

In my opinon the strength of Eclipse is of course the flexible modular concept which enables the user to pick additions from a large variety of choices. The weakness is the complexity which is the price for the flexibility. For our project we’re lucky since everything we need works “out of the box” if an actual version of Eclipse is used. So if you like to follow me go to www.eclipse.org/downloads and pick the most recent one under “Eclipse IDE for C/C++ Developers”. You might end up with the one I have:

eclipse-cpp-kepler-SR1-win32.zip

Similar to our gcc compiler we don’t need an installation process for Eclipse. Again we just download and extract the zip file to your local harddrive. A good place for Eclipse is:

C:\Eclipse

Step 3: Set up GNU Make

With gnu make we face a little bit of a challenge. The GNU philosophy is to distribute everything as source code. Also the make tool (I’m not 100% sure if this makes sense or not). I had a binary set of binutils on my harddrive from a while ago, but unfortunately the yagarto project is closed. Therefore I decided to make

yagarto-tools-20070303-setup.exe

available here for download.

A lazy dog like me who hates to tweak the PATH settings all the time just extracts everything from the .exe file and put the content of the \bin folder into

C:\Windows

In my opinion there is so much stuff which shouldn’t be in the Windows folder that is doesn’t hurt to have some useful stuff there as well. Besides make the yagarto-tools contain also touch and rm and other useful things which help to keep Makefiles very compatible between Windows and Linux.

Note: I personally like to work with make and a manually edited Makefile. This gives me the good feeling that I am “in control of things”. Eclipse has a build-in make which I avoid because I switch editors very often. If you want to use the Eclipse make process please stop reading here and go back to Google.

Step 4: Our HelloBone sample project

The hopefully last download for today is the HelloBone.zip file. Download and extract the content anywhere you want. I stored my project here:

C:\work\hellobone

Step 5: Check if you can compile without Eclipse

At first you shoud check if make is really visible from everywhere. Open a command shell and go to your working directory where Makefile resides and type make -v

c:\work\hellobone>make -v 
GNU Make 3.81 Copyright (C) 2006  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.  

This program built for i686-pc-mingw32

If your result is similar to what you see above we’re good to go. Try make without argument and you shoud see:

c:\work\hellobone>make
.
---COMPILE---  c:/work/hellobone/source/hellobone.c
"C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe" -c -o c:/work/hellobone/object/hellobone.o c:/work/h
ellobone/source/hellobone.c -marm -O0  -g  -Ic:/work/hellobone/include
.
---COMPILE---  c:/work/hellobone/source/tools.c
"C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe" -c -o c:/work/hellobone/object/tools.o c:/work/hello
bone/source/tools.c -marm -O0  -g  -Ic:/work/hellobone/include
.
---LINK---
"C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe" -o hellobone c:/work/hellobone/object/hellobone.o c:
/work/hellobone/object/tools.o -marm -O0  -g  -Ic:/work/hellobone/include
.
---SUCCESS---  hellobone

c:\work\hellobone>

In case you see the —SUCCESS— message you’re done and we can continue with Eclipse. In case you don’t please feel free to jump back to Step 1 and try again.

Note: If you check the Makefile you’ll find that I did it a little more complicated compared to what’s really necessary. First we compile two source files with two header files (like in every good example they do almost nothing). Secondly they are in different directories.  The object files are placed in a seperate directory as well. But if you are a beginner and you use this structure as a seed for your future projects you will love me for that later on. Handling only a few more source files and having them together with object and include in just one directory starts hurting quickly if the project is growing.

Step 6: Start Eclipse

My recommendation is to double click on

C:\Eclipse\eclipse.exe

The result should look like the screenshot below. If not it might be neccessary to install or update JAVA at this point in case your machine isn’t ready for Eclipse yet.

eclipse1

Click on the Workbench symbol and a virgin IDE should welcome you:

eclipse2

Since we don’t want to use the internal make functions of Eclipse the next step is to tell Eclipse where our project resides. Open File – New – Makefile Project with existing code and navigate to our project folder. Use <none> as the toolchain setting for now. Feel free to go deeper into the Eclipses possibilities later when our little lesson here is over.

eclipse3

Afterwards the Eclipse IDE should (almost) look like this if you did what I did and opened the hellobone.c file by navigating through the Project Explorer. You will already notice why I put certain files in different directories: Eclipse uses the directories for project navigation automatically.

eclipse4

Now if you hit Project – Build all Eclipse should be able to execute the same make process we used in Step 5. You should see the output of our make process in the Console window. With Project – Clean you should also be able to clean our project as described in the Makefile.

Note: If you follow Project – Properties – C/C++ General – Preprocessor Include path and add

C:\gcc-linaro\arm-linux-gnueabihf\libc\usr\include

as a File System Path under CDT User Setting Entries the Eclipse Code parser knows where our #include files are and the nasty question mark symbols will disappear. Better for the eyes. But compilation works also without it if you don’t care about your eyes too much.

So we’re done cross compiling our project. That means we’re ready for the next step:

Step 7: Remote deploying to the BeagleBone

I use two different BeagleBones: The whitebone one runs Angstrom and the blackbone one Debian. Our project here is running on both. Some minor changes need to be made in the Makefile for Angstrom (see the CFLAGS section in the Makefile). For session here I’m using the blackbone and my setup is:

host: blackbone
ip: 192.168.1.15
sshd: running
user: root
password: ********

Eclipse already knows that people like us want to put stuff on toys like the BeagleBone. Therefore Eclipse is equipped with modules like Window – Show View – Other – Remote Systems – Remote Systems. Follow me on this one and you should be able to see what I see:

deploy1

If you click where the little Define a connection to remote system button is (red circle) a dialog appears where you can select SSH only first and hack in your BeagleBone personality afterwards. In my case:

Hostname: 192.168.1.15
Connection name: BEAGLEBONE
Description: BEAGLEBONE

If you double click on Sftp Files a dialog for user name and password appears like expected. I recommend to check the Save User Id and Save Password checkbox since we might need to login more frequently in the near future.

Note: BE CAREFUL NOT TO SCREW UP HERE. I did it once and it took me a while to find out where Eclipse stores this kind of information.

Of course you might also see some SSH key acceptance dialog which I recommend to accept if you trust your BeagleBone.

deploy2

Now we can browse through the BeagleBone file system. Isn’t that nice? (A feature which a regular Windows Explorer user might never see all his live).

So our connection is there which means we are ready for deployment. Open Run configurations… in the pull down menu next to the run button (this time the red circle in the screenshot above became an oval by accident) and add a new Run configuration under C/C++ Remote Application. Eclipse names it hellobone Default automatically.

Select your Connection BEAGLEBONE (or however you named it) and make sure you fill everything else out like I did:

deploy3

After saving our settings with Apply we can Close this dialog and hit hellobone Default in the Pull Down menu of the Run Configurations button (red oval, remember?). If everything goes well our binary gets sent to the BeagleBone and is executed afterwards. In the screenshot below you might notice the printf output of our little software in the Console window which tells us that we’re running.

deploy4

Now is this something or what? But hold on: It’s getting even better in

Step 8: Remote Debugging on the BeagleBone

In the same way we opened our hellobone Default in the Run Configurations… we open now the Debug Configurations… which is in the pull down menue next to the sweet little green bug symbol. You will notice that the settings from hellobone Default are already prepopulated.

Change to the tab Debugger and browse to the gdb binary of our linaro toolchain to select the GDB debugger you want to use. (We are very lucky that we installed one in Step 1 by accident)

C:\gcc-linaro\bin\arm-linux-gnueabihf-gdb.exe

The GDB command file you can leave untouched or empty it. This doesn’t make a difference for now. Your settings should look like the screen below. Believe it or not that’s all.

debug1

You might have noticed that we tell the debugger to stop at main if we leave the check box as is. After using the buttons Apply and Debug (or Close and pull down bonehello Default next to the sweet little green animal) we should be ready to rumble:

debug2

Eclipse changes the perspective from C/C++ to Debug and gives you notice about that. You can always jump forth and back between these perspectives by using the buttons in the upper right corner.

You can Start (Resume) and Stop (Terminate) your program with the symbols in the toolbar. You also might have noticed that the debugger stoped as promised at main() and you see that a variable from the actual context “i” is shown as well.

The last thing we do is to set a breakpoint by clicking on the blue bar on the left hand side where our code says printf(“FIVEx\n”); (Aha, that’s the reason why his sample programm doesn’t just print “Hello world!” once).

By the way breakpoints can be set in each perspective, which means also in the C/C++ coding view.

Now hit Start (Resume) and see what happens:

debug3

The execution stops at our breakpoint. The console output also. The variable “i” has changed to the value 5. Eclipse helps us by highlighting this in yellow.

Is this cool or what? We’re done! Enjoy the moment! Go and grab a beer!

Here ends our little journey. I hope you enjoyed it. Feel free to leave a comment if something is unclear and should be improved or if you have any other remarks after reading this.

Support or Contact

Like most of the BeagleBone users I do this only for pleasure in my spare time. Therefore be patient if I’m unable to answer your questions right away. But don’t hesitate to enter your questions down below and I see what I can do…

88 thoughts on “HelloBone

  1. Thanks for all of your posted information. It is a great help.

    I am a controls engineer in Canada.
    I write software for machine automation. In the last few years I have been using Java to develop my HMI interfaces. Lately I have taken interest in the Beagle Bone Black.
    I thought I should use Android NDK to interface with hardware sensors.

    I like Java and in the past few days I have thinking that Java with JNI to C code would be better?
    What are your thoughts about Android NDK vs. Java JNI applications.
    (I am using sensors that are connected to the I2c bus on the Beagle bone Black.)

    1. Thanks Elaine,

      I’m afraid I don’t know enough about either Android NDK or Java JNI. My “thoughts” about this are therefore somewhat limited.

      So far my personal background is (and always was) embedded C with or without Linux. To get some sensor information via I2C my first choice would be Linux and C as well.

      1. HI Elaine,
        I thought the Android NDK is good choice and trying to use this option in LL for interface with the device data.

        Did you get this done already?

  2. Hi I, (you only refer to yourself as I)
    Great blog, clean neat and tidy, much faster than a video. I wonder if you can describe very briefly what SW tool you used to construct this page. Thanx.

    1. Hi Paul,

      the name is Joerg by the way. (I always had the feeling that I forgot something).

      As I replied earlier I used WORDPRESS to create this page. All you need is a webhoster who provides you with MySQL and PHP5. Just put the WORDPRESS stuff on the server and follow the famous “5 Minutes install instructions” from WordPress. All the CSS design stuff is “build in” and comes “automatically” so to say. This design is called “Twenty Thirteen” and I didn’t change anything.

      Thanks for your comment.

      Joerg

  3. Hey there! I was wondering if you had any suggestions on further reading for a noob like me so that I could get more of a feel for this kind of stuff. I’m very new to embedded programming and this was an excellent tutorial. Thanks!

    1. Hi Jamil,

      unfortunately no, I don’t have further recommendations for you.

      If you were able to follow this tutorial you have the “basic concept”. It’s always about a cross compile toolchain, the MAKEFILE, how to transfer the binary to your embedded target and how to debug your code (with or without additional hardware like JTAG adapters).

      I bet there are millions of websites about embedded development but most of them are tailored to “professionals”. Maybe this is why I felt that my tutorial could be helpful for somone who needs a starting point…

      Thanks

      Joerg

  4. I downloaded the same gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_win32 you did, I can’t seem to find the header files and the lib files to link to my application. there isn’t a root/include and the root/lib takes a long path to get to something. Without the header link I can’t make any progress. How did you solve this problem.

    1. Ray,
      the include files are in C:gcc-linaroarm-linux-gnueabihflibcusrinclude as described in Step 6. You’ll find them where Eclipse can find them. To link a prebuild library you should modify the Makefile. For example add ‘-lpthread’ to the CFLAGS if you use POSIX thread functions in your code. I never needed to reference the complete path. The gcc compiler handles this somehow.

      By the way I found a second good source for a toolchain. The ‘make’ stuff is already included. If you want you can try beaglebone-gcc4.7.3.exe from SysProgs. Maybe this one fits you better.

      Have fun
      Joerg

  5. Hey, you like things just the way I like them! Your efforts and the sharing of those efforts have saved me a lot of time. Thank you, Joerg.

  6. Hello
    Thanks for your nice tutorial first.
    and I have a problem at step 5.When I type in “make -v”,it shows exactly like what you showed there,but then when I type in “make”,it says that “multiple target patterns,stop “.Do you have any ideas why is that happening?

    Thank you for your help!

    1. I never saw this error message. Do you see the same version with “make -v” (GNU Make 3.81)? Could it be that you have another make tool in your path? You can also try “make all”, “make -B” or “make -B all”. The “-B” is to force a build and “all” explicitly defines the target.

      If this doesn’t help you might want to read the make documentation or try to google the error message. It could be that my “Makefile” is not 100% bulletproof but it always worked for me.

  7. Hello,

    first’ Your Project good helper to me, Thankyou

    unfortunally I am having problem as the remote run and debuging,

    I am running eclipse Kepler under windows7 and targeting a beagleboneblack ARM board.
    but don’t run and gets message eclipse
    “Error during file upload.
    Operation failed. File system input or output error
    Operation failed. File system input or output error
    Operation failed. File system input or output error

    If I manually executable run in beaglebone board, it’s ok, fine

    Thanks for any help, this is driving me nuts since it *almost* works.

    1. Hi,
      do you use Debian or Angstrom on your board? An “Error during file upload” sounds like an access rights problem in your work folder on the board. Are you able to do do sftp (e.g. with FileZilla) and upload a file? Or is it possible that your program doesn’t get terminated properly (means does it show up with “ps -A”)?

      Honestly I remember that I also saw this message once. But I don’t recall what I did to get rid of it. Except trying again…

  8. I am having the same problem. I get the errors
    Error during file upload.
    Operation failed. File system input or output error
    Operation failed. File system input or output error
    Operation failed. File system input or output error

    I can see the file in filezilla that eclipse put on the beagleboard. If I try to execute it on BBB, it doesn’t run. Then if I sftp it from Win7 onto the beagleboard, I can run the program. Any help would be greatly appreciated! Thanks.

  9. OK, I’ve figured it out :

    “Select configuration using C/C++ Application” check box is NOT selected

    use: chmod a+x /yourappinstalldir/hellobone

    Hope that helps!

  10. I have a problem in step numbr 7. I cannot do the remote settings. I am using ubuntu OS. It always give me an error “Failed to conect sshd in “192.168.58.232:22″”. I have tried to bypass firewall but no all in vain. Can you please help e that where i am gtting wrong. I will be thankful to you.

    1. Usman,

      that’s a tough one. Hard to give advise based on your info. Let’s start here:

      – Do you use Ubuntu on your host PC or on the bone?
      – If on the bone, are you sure your sshd (ssh server) is running properly?
      – Can you log in from Windows via “putty.exe” or another ssh client terminal?

      Joerg

  11. Be sure to remember that this tutorial is using the “blackbone” which is running Debian (mentioned in step 7). This is somewhat confusing because one would think that the “blackbone” would be a beaglebone black which normally runs Angstrom. I just bought a beaglebone black and I encountered a problem which others seem to be having. At step 7 when I tried deploying/running the program I was given the error:

    Error during file upload.
    Missing element for :”
    Missing element for :”
    Missing element for :”

    When trying to determine the solution I was also given a similar error:

    Error during file upload.
    Operation failed. File system input or output error
    Operation failed. File system input or output error
    Operation failed. File system input or output error

    Here is how I fixed both of these errors: at step 7 make sure your directories are correct!

    In the “C/C++ Application” field use the browse button to make sure what you entered is valid. If you aren’t using Eclipse’s workspace then you will need to browse to your file location. My file location was: C:\work\hellobone\hellobone.
    Second, check the file path entered in the “Remote Absolute File Path for C/C++ Application ” is valid. This is where the difference between using Debian and Angstrom presents itself. For Angstrom, the file path should be “/home/root/hellobone” instead of “/root/hellobone”. It doesn’t necessarily matter that you place it at the same location as I did, but just be aware that the home directory needs to be added before “/root” if using Angstrom.

    Lastly, I followed the advice that mmm_ny gave. Be sure that the check box for “Select configuration using C/C++ Application” is NOT selected and use:
    “chmod a+x /yourappinstalldir/hellobone”.

    1. I just checked to see if my program would still run if I DID check the “Select configuration using C/C++ Application” check box and changed
      “chmod a+x /yourappinstalldir/hellobone”

      to

      “chmod +x /yourappinstalldir/hellobone”.

      It still ran so it seems as though you don’t need to do that. Oops!

    2. Andrew,

      the “blackbone” is a beaglebone black which normally runs Angstrom out of the box, but I took the freedom to install Debian instead. It just feels more like a “real” Linux. (please forgive me you Angstrom developers out there).

      Thanks for your reply.

      Joerg

  12. C:\BeagleBone Projects\HelloBone>make -v
    GNU Make 3.81
    Copyright (C) 2006 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.

    This program built for i386-pc-mingw32

    C:\BeagleBone Projects\HelloBone>make
    makefile:69: *** multiple target patterns. Stop.

    Can someone please help me with this.

    I googled this error, but nothing makes sense to me.

    Thanks

    1. Don,

      I have the same result if I try to use ‘C:\BeagleBone Projects’ as a work folder.

      Try to rename it to ‘C:\BeagleBoneProjects’ (without a space) and it should work. I tested it myself real quick and this seems to solve your problem.

      The reason is that the make tool is a bit older and might not like “modern” Windows path name conventions where spaces are allowed.

      Have fun
      Joerg

      1. Thank You,

        now I have this:

        C:\BeagleBoneProjects\HelloBone>make
        .
        —COMPILE— C:/BeagleBoneProjects/HelloBone/source/hellobone.c
        “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe” -c -o C:/BeagleBoneProjects/Hell
        oBone/object/hellobone.o C:/BeagleBoneProjects/HelloBone/source/hellobone.c -marm -O0 -g -I. -IC:/BeagleBoneProjects/HelloBone/include
        The system cannot find the path specified.
        make: *** [C:/BeagleBoneProjects/HelloBone/object/hellobone.o] Error 1

        C:\BeagleBoneProjects\HelloBone>

  13. Does the hellobone project work on the BeagleBone Black (BBB). I did a ‘make’ in Step 5. It generated an executable of hellobone. I transfer it to the BBB using WinSCP. and made it executable by ‘chmod 777 hellobone’ then ran it by doing ‘./hellobone’ and got “-sh: ./hellobone: No such file or directory” on the BBB

    1. Steve,

      important question: Do you use Debian or Angstrom on your BBB? Open the ‘Makefile’ and go to the line ‘TARGET=angstrom’. For Angstrom this line has to be active. For Debian you need to deactivate the line by adding a ‘#’ character in front (comment it out).

      The TARGET switch activates two additional compiler switches (CFLAGS) necessary for Angstrom Linux.

      Joerg

  14. In the end of step 6:
    * In Eclipse add Include path
    * C:\gcc-linaro\arm-linux-gnueabihf\libc\usr\include

    The “?” should go away, right ?

    It doesn’t , and clicking on the fcntl.h in the outline window states:
    “No include files were found that matched that name.”

    How can I do that wrong ?? :-(

    The path looks correct.

    1. I’ve had the same problem but solved it by adding the include directory in
      properties>c/c++ General >Paths and Symbols
      which removed the “?”

  15. Don : I had the same issue as your message of April 29th what did you do to get it to work?

    Joerg : thanks so much for posting this information.

  16. OK I just got mine to work now.

    My path to the gcc binaries was different than yours so I had to put my path into the makefile.

    Once again thanks for posting this article.

  17. Thanks for posting

    I have the same error that don (April 29, 2014 at 18:27):

    C:\work\HelloBone>make
    .
    —COMPILE— C:/work/HelloBone/source/hellobone.c
    “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe” -c -o
    C:/work/HelloBone/object/hellobone.o
    C:/work/HelloBone/source/hellobone.c -marm -O0 -g -I.
    IC:/work/HelloBone/include

    The system cannot find the path specified.
    make: *** [C:/BeagleBoneProjects/HelloBone/object/hellobone.o] Error 1

    C:\BeagleBoneProjects\HelloBone>

    Can someone help me? Don forgot to explain the solution for the problem.

    Thanks for all.

    1. Fran,

      please check the Makefile. There should be a line like
      CC = “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe”
      You should make sure that this path to the gcc binary matches to your installation 100%.

      You can also reduce the line (and the next one) to
      CC = arm-linux-gnueabihf-gcc.exe
      and add “C:\gcc-linaro\bin\” to your Windows PATH environment variable.

      I really don’t have another idea. On my machine(s) it always works as described. But the error message means “I cant find the gcc executable”. That’s for sure.

      Joerg

  18. I loaded everything into my computer just as the documentation showed, directories and all. when I do the make -v everything does as expected. When I do make I have an error.
    The system cannot find the path specified.
    Make: *** [C:/work/hellobone/object/hellobone.o] Error 1
    I have reading where Don and David had a similar problem. I am not seeing what I am doing wrong.

  19. Thank for your advise!

    Now works. It was a problem whith a incorrect PATH.

    Once again thanks for the article.

  20. Awesome job. Really liked your work. I am new in Linux but liking it so far. Anyway I also ran into an issue with the debugger. It couldnt start the gdbserver on the remote host.

    root@arm:~# sudo chmod +x test/hellobone;gdbserver :2345 /root/test/hellobone;ex it
    -bash: gdbserver: command not found
    logout

    Looks like i have to have the gdbserver on the beagle-bone.

    1. You might need to install gdbserver on your bbb.
      If you’re running debian, just type apt-get install gdbserver
      i dont know what the package installer is on angstrom

  21. Many thanks for the efforts in sharing this insight. Worked like a charm. It would have taken me a week to figure all this out myself.

  22. Hi!
    D:\hellobone\ make

    Error makefile 12: command syntax error
    Error makefile 42: command syntax error
    Error makefile 45: command syntax error

    D:\hellobone\ make -v

    Incorrect command line argument : -v
    Where could be the problem?

  23. First off, thank you so much for posting this site! This is the best turorial I’ve found on this subject.

    I’m new to both eclipse and C/C++ and have what I’m sure is an exceedingly stupid question. It seems gcc-linaro doesn’t include iostream in its library of headers. Does anyone know if it is simple to add this?

    Thank you in advance!

  24. Hi, I’m trying to set up Eclipse (Luna) on Windows 7 x64 for c++ cross-compile and remote debug with BeagleBone Black Rev C (Debian) as the target device.

    Following your steps I get to the make for the test project and receive “bits/predefs.h: No such file or directory”. This seems to have something to do with 32 vs. 64 bit but I can’t figure out how to solve it.

    Any advice will be appreciated.

    Thanks in advance.
    Bob

  25. Thank you for sharing the result of your trials. In one respect I feel I cheated by not falling on my own face, but in another I am glad I can start developing code.

  26. Hi,
    Many thanks for the great work!

    I am using a 64bit Win7 machine. Downloaded Linaro, Eclipse (64bit version) and Yagarto and followed everything as per your instructions up to Step#4.

    Then at Step #5 got:
    C:\>cd work\hellobone
    C:\Work\hellobone>make -v
    GNU Make 3.81
    Copyright (C) 2006 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.

    This program built for i686-pc-mingw32

    but at Step#6 got error:
    C:\Work\hellobone>make
    .
    —COMPILE— C:/Work/hellobone/source/hellobone.c
    “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe” -c -o C:/Work/hellobone/object/h
    ellobone.o C:/Work/hellobone/source/hellobone.c -marm -O0 -g -I. -IC:/Work/hel
    lobone/include
    ‘”C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe”‘ is not recognized as an intern
    al or external command,
    operable program or batch file.
    make: *** [C:/Work/hellobone/object/hellobone.o] Error 1

    C:\Work\hellobone>

    Any idea on the cause of error?

    Thanks in advance

  27. Found an issue: actually downloaded “gcc-linaro-armeb-linux-gnueabihf-4.8-2013.09_win32.zip instead of “gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_win32.zip” so obviously filename are different!

    But after downloading “gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_win32.zip” and copied into a clean C\gcc-linaro folder and when “Make -v” is issued, all good as expected:
    C:\work\hellobone>make -v
    GNU Make 3.81
    Copyright (C) 2006 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.

    This program built for i686-pc-mingw32

    but when “Make” is issued got this message instead:
    C:\work\hellobone>make
    make: Nothing to be done for `all’.

    Not sure if messed up some system settings?

    1. Success at last :) Googled and issued a “make -B” command to force a new build and worked.
      I guess some previous attempts produced a complied version already and “Make” will not override it.

  28. Next problem:
    Eclipse launched fine.
    Asking for default workspace (not shown in the procedures)
    Entered C:\work\hellobone and Virgin IDE displayed as expected

    But Project Explorer does not seem to load and populate the Makefile Project as in C\work\hellobone following Step5. Workspace remaining as virgin IDE

    Any ideas?
    Thanks in advance

  29. Everything went well until the end of step 7, when the file transfer to the BBB was refused due to ‘lack of permission’ I have ubuntu installed from http://elinux.org/BeagleBoardUbuntu#eMMC:_BeagleBone_Black with the default user ubuntu using the default password. I was not sure about the line ‘chmod +x hellobone. Hard to tell if it was ‘+x’ or ‘-x’ so I tried both. The folder \root\hellobone was not created on the BBB, so I went in with PuTTY and created it, then checked with WinSCP to be sure it was there. Same problem file transfer refused.

  30. Guys after 4 boring hours of searching I solved this problem make: ***
    —COMPILE— C:/Work/hellobone/source/hellobone.c
    “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe” -c -o C:/Work/hellobone/object/h
    ellobone.o C:/Work/hellobone/source/hellobone.c -marm -O0 -g -I. -IC:/Work/hel
    lobone/include
    ‘”C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe”‘ is not recognized as an intern
    al or external command,
    operable program or batch file.
    make: *** [C:/Work/hellobone/object/hellobone.o] Error 1

    1. put everything from hellobone to c:\\work, that means you must copy\cut all from c:\\work\hellobone to c:\\work and delete hellobone folder. So now you have in work folder 4 files – include,object,source,Makefile.
    2. After first step,you have to open with some kind of text editor Makefile from c:\\work folder and find a row with this
    # gcc binaries to use
    CC = “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe”
    LD = “C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe”
    Make a sure that this path C:\gcc-linaro\bin\arm-linux-gnueabihf-gcc.exe is absolutely same like a path on your PC of that “bin\arm-linux-gnueabihf-gcc.exe” file.
    If this doesnt help you, than try all kind of make command, make -B all,make all…
    Good luck

  31. Hi Joerg,
    Thank you so much for this very nice and clear tutorial.
    It works for my new Beaglebone Black (2 days old) and … XP ! (yes, I know).
    I also like the Makefile ….
    Eric.

  32. Just wanted to put what roadbumps I had in case someone else has them. I’m using the default Angstrom distro too.

    Error during file upload, missing element for: ”

    The fix was for the
    ‘Remote Absolute File Path for C/C++ Application: ‘

    field I had to put

    /home/root/hellobone

    Error was:

    -sh: /home/root/hellobone: No such file or directory

    Fix was to uncomment the
    #TARGET=angstrom

    So in the end it was just

    TARGET=angstrom

    Hopefully that helps some lost souls out there..

    Otherwise thanks for the tutorial! It’s gained me more functionality than all of the other ‘getting started with the bbb’ online whooty-whatties so far.

  33. hi,
    thank u so much for your wonderful website.
    i am new in linux programming and in my new project i should write some programs and run on portuxg20 embedded system .
    i fallowed your step but when i want to run my program on my linux board i get this message and i really do not know what can i do for solving this problem .
    root@portuxg20:~# echo $PWD’>’
    /root>
    root@portuxg20:~#
    root@portuxg20:~# chmod +x /root/hellobone;/root/hellobone;exit
    -sh: /root/hellobone: not found
    i really appreciate if you could help me.
    i am waiting for your answer.
    best

  34. Hi,
    Can i use cross compiler “gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_win32.zip” in win64 bit operating system in windows 8

  35. Thank you for the most excellent tutorial. I’m on a tight schedule and this really saved me a lot of time getting Eclipse running with the BBB. Hope to buy you a beer one of these days!

  36. I got through the setup until I tried to connect to the BBB through eclipse. When logging in it filled in the user name (my windows login) and there is no user set on the BBB for that. I can’t change it to root. A blank password doesn’t work. Help?

  37. I almost have this working. The one problem remaining seems to be to do with make.

    in a CMD window, make -v works in various locations, in the hellobone folder it compiles as you show above.

    In eclipse:
    When I run build all I get this output in console,

    22:39:47 **** Build of configuration Default for project hellobone ****
    make
    make: *** No targets specified and no makefile found. Stop.

    22:39:47 Build Finished (took 105ms)

    I haven’t touched the make file except to set the path to gcc-linaro. I am running Debian on the BBB.

    I also get a message in problems

    Description Resource Path Location Type
    make: *** No targets specified and no makefile found. Stop. hellobone C/C++ Problem

    The Make file is visible in the left panel.

    The nasty ?’s didn’t disappear against the include files when I set the path to the pre-processor. I browsed to the folder and double checked it. I presume this wouldn’t help.
    Project – Properties – C/C++ General – Preprocessor Include path set to
    C:\gcc-linaro\arm-linux-gnueabihf\libc\usr\include

  38. Just want to thank you for providing this detailed info. It worked perfectly with my Debian BBB, even though I used a different toolchain on the Win 8 host.

    Cheers,
    Alex P

  39. Almost there, but I screwed up the password stuff.
    But first, my IP is 192.168.7.2 (obtained from E:\START.htm on my bone), which pings ok. How did you arrive at 192.168.1.15? btw, I have BBB Rev C.
    Please help reset password.
    thanks………..dd

    1. Hi Jose Juan,

      thanks for your positive feedback and also thanks for the link. I created this page in November 2013 and never checked what happened in the meantime concerning toolchain, Eclipse or other BBB Linux versions. Therefore your hint might be helpful for others. My BBB collects a little bit of dust lately. Most of the time I do some SAP coding these days. I might start another tutorial sometime for another audience ;-)

      But it is always refreshing so see a positive comment like yours without “problems”…

      Have fun
      Joerg

  40. Hi,

    I ve done all this but when I try to debug, the debugger reports:


    Remote ‘g’ packet reply is too long: 0000000017f9ffbe00000000000000…

    1. Hello GT,

      I ran into the same problem. it seems to be a problem with the gdb which is included in the linaro toolchain. As the debian on my BBB uses gcc 4.9.2 i also installed a toolchain from http://gnutoolchains.com (i took the rasbian toolchain for gcc 4.9.2) and just took the binaries for make and gdb into my linaro toolchain… now it works for me…

  41. Hi Joerg,

    Just what I need, and as far as step 5, no problems.

    Step 5 compile without eclipse
    ‘make -v’ delivers as specified, except “This program built for i686-pc-msys”,
    NOT -pc-mingw32.

    But ‘make’ with no arguments delivers:
    c:\work\hellobone>make
    Microsoft Windows [version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.

    c:\work\hellobone>

    I have edited c:\work\hellobone\makefile to point at

    # gcc binaries to use
    CC = “C:\linaro48\bin\arm-linux-gnueabihf-gcc.exe”
    LD = “C:\linaro48\bin\arm-linux-gnueabihf-gcc.exe”

    I am a novice in this field, running Win8.1. I have a working MSVC toolchain, which Eclipse finds, but I have no working gcc toolchain.

    Could that be why ‘make’ does nothing for me?

    Or do you have any other suggestions?

    thanks Tom

  42. Thaks a lot. I banged my head with remote debugging using a JTAG debugger. Now, thanks to you, i can do it without it. Great Tutorial!

  43. Hi Joerg,

    Everything worked great up until the end of Step 7. I’m running Ubuntu 14.04.1 on the beaglebone. It downloads the binary, changes permissions, but then I get the error: -bash: /home/ubuntu/hellobone: cannot execute binary file: Exec format error

    Any help would be appreciated.

    Thanks,
    Ron

    1. Hi Ron,

      back then when I did this tutorial I worked with ANGSTROM and DEBIAN. I didn’t find the time to play with UBUNTU so far. The two different Linux version I used did not work with the same binary. That’s why I have the switch ‘#TARGET=angstrom’ in my ‘Makefile’. If the switch is enabled two extra CFLAGS are active: ‘-march=armv4t’ and ‘-mfloat-abi=soft’. This option created a binary which was working for ANGSTROM but not for DEBIAN. Without the flags the situation was vice versa. To be honest: I did not understand completely what I did but I found some hint somewhere. I would check two things:

      • Try to find a working ‘Makefile’ somewhewe and use these CFLAGS in yours
      • Try a more modern gcc toolchain. The one I use might be a bit outdated today. The comment from Jose Juan on this page refer to alternative gcc toolchain as a starting point

      Sorry but thats all I’m able to provide.

      Good Luck
      Joerg

  44. Hi Joerg,

    You have pointed out the cross toolchain from Sysprogs that came together with make file. Does the setup you’ve laid above follows?

    TQ

    1. Sam,

      it should. You basically do step 1 and 3 at once. But forgive me if I can’t confirm completely. I tried this stuff in March 2014 and don’t remember every detail…

      Have fun
      Joerg

      1. Sam,

        one more thing: The toolchain comes with the ‘make tool’ (binary), not with the ‘Makefile’. That is in the HelloBone.zip.

        Joerg

  45. Hi Joerg,

    Thanks a lot for this clear tutorial.
    I just had to do a little bit of hunting for the gcc on the limaro web site. After that, everything worked fine up to the command line make. When I tried to build the project from the eclipse GUI, Step 6, the Console displayed an error message about “make” not being found in the PATH.
    Googled that and learned that eclipse will not always pick up the PATH from Windows Environment, so added it via Project | Properties | C/C++ Build | environment| Add and gave it the location of make.exe.
    After that all was smooth sailing.
    Working from within Windows is so much easier than installing Virtual Box, then Debian Jessie inside that, then eclipse, and so on & on…!

  46. Hi,

    i’m blocked at Step 5 , the commande “make -v” work correctly but not the command “make” , any idea how to fix this issue plz ??

  47. Hello Joerg,

    Appreciate your efforts here. I have a problem. Make -v works as you show, but make with no arguments (or make all, make -b..) gives me the error:
    The system can not find the path specified.
    make: xxx [c:/work/hellobone/object/hellobone.o] error 1

    any ideas?

    Jim

  48. Hi Joerg,
    great tutorial. I never got this far trying others!!
    One problem remains for me – dbgserver: command not found.
    In one comment above it was suggested to install it but Debian replies with:
    Package gdbserver is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package ‘gdbserver’ has no installation candidate
    Many thanks for help – I am completely new to Linux…

    1. …just found out myself. gdbserver indeed is not included in the most recent BBB image(s). The package can be found here:
      https://packages.debian.org/sid/armhf/gdbserver/download
      The downoaded .deb file is then copied to the BBB using Eclipse Remote Systems (local Files -> Sftp Files). On the BBB a remote shell is launched (also via Eclipse) and the package is installed by:
      sudo dpkg -i .
      Now for me everything works just fine (:-)

      1. Addendum – sry, the website editor truncated the installation command.
        The name of the .deb file must be appended to the sudo dpkg… line.

  49. Hi Joerg,
    as stated above everything works fine – with C. With C++ I encounter the annoyance that std ist not recognized by the compiler. Astonishingly the program compiles/runs/debugs though. Any idea to solve this problem (even after hours I did not find a solution in the web)?
    Many thanks again.

  50. Me again, meanwhile and after some more hours I found out the solution – a lot of include paths have to be set in C++ General Properties – Preprocessor Include Paths… Therefor you have to enable CDT Managed Build Settings Entries in Providers (but only this!) and then add the following entries:
    C:\gcc-linaro\arm-linux-gnueabihf\include\c++\4.8.2
    C:\gcc-linaro\arm-linux-gnueabihf\libc\usr\include
    C:\gcc-linaro\arm-linux-gnueabihf\include\c++\4.8.2\arm-linux-gnueabihf
    C:\gcc-linaro\arm-linux-gnueabihf\include\c++\4.8.2\arm-linux-gnueabihf\arm-linux-gnueabi
    C:\gcc-linaro\lib\gcc\arm-linux-gnueabihf\4.8.2\include

Leave a Reply to usman Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>