C++ Development

SYSTEM:
Hello I have gotten Angstrom Running on my BB. I am now interested in
writing code for a robot. This robot will require a few virtual comm
ports over USB. I am interfacing to a board that ONLY SENDS serial at
115200 over the usb to the BB, and there is also a uC that will be
SENDING/RECEIVING at 115200 with the beagle board.

PLAN:
Basically I would like to develop a C++ library and complete program
for communications with the two boards at the same time.

QUESTIONS:
First off I am using windows and I have had the same results running
vmware linux ubuntu 8.10

(0.) I have been trying to get the code Sorcery compiler to work but I
have run into some issues. Is it free?..because I cannot get this to
work.

http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

When I install CODE Sorcery it does not install an executable it just
installs documentation and an uninstaller. Does the free version have
a graphical user interface?...With that said can someone write a
tutorial for setting up a c compiler for the BB system it would be
greatly appreciated to have a hello world program that is simple and
straight forward. So how do I get it to run. Should I be using
CodeComposer Studio with Eclipse?...or should I be using some other
library to develop with Eclipse?

(1.) Is this possible with the drivers that are already available on
the board/ Or should I write Some new drivers?

(2).If I need to write drivers what is the best free environment for
writing drivers? Also is there a c++ compiler already on the BB board
when using the angstrom setup...and if so how is it accessed and where
can I find info on the libraries it uses? Also is there a hello world
tutorial for it.

(3.)To give a little back ground I have run a c++ program and made a
driver before using GCC on a TS-3300. Is there a similar development
environment on the BB?

(4.) Lastly can Anyone make a demo for a program that runs directly on
boot up. So that when the SBC is powered on it goes directly into a c
program? I am not sure if anyone has done this with the board yet?

Sorry I know there are many similar posts and examples out
there...unfortunately I am still running into some issues. Thanks for
any help in advance!

SYSTEM:
Hello I have gotten Angstrom Running on my BB. I am now interested in
writing code for a robot. This robot will require a few virtual comm
ports over USB. I am interfacing to a board that ONLY SENDS serial at
115200 over the usb to the BB, and there is also a uC that will be
SENDING/RECEIVING at 115200 with the beagle board.

PLAN:
Basically I would like to develop a C++ library and complete program
for communications with the two boards at the same time.

QUESTIONS:
First off I am using windows and I have had the same results running
vmware linux ubuntu 8.10

(0.) I have been trying to get the code Sorcery compiler to work but I
have run into some issues. Is it free?..because I cannot get this to
work.

http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

When I install CODE Sorcery it does not install an executable it just
installs documentation and an uninstaller. Does the free version have
a graphical user interface?...With that said can someone write a
tutorial for setting up a c compiler for the BB system it would be
greatly appreciated to have a hello world program that is simple and
straight forward. So how do I get it to run. Should I be using
CodeComposer Studio with Eclipse?...or should I be using some other
library to develop with Eclipse?

CCSv4 has an Eclipse interface, but the Linux support for the ARM
compiler is currently somewhat limited.

Code Sourcery does have an Eclipse IDE interface for the non-"Lite"
versions. I think you just haven't gotten the install process quite
right or haven't found where the files were installed.

(1.) Is this possible with the drivers that are already available on
the board/ Or should I write Some new drivers?

I'm a bit confused by the statement that your control board sends
serial over USB. There are USB serial adapter drivers in Angstrom, so
you should be OK.

(2).If I need to write drivers what is the best free environment for
writing drivers? Also is there a c++ compiler already on the BB board
when using the angstrom setup...and if so how is it accessed and where
can I find info on the libraries it uses? Also is there a hello world
tutorial for it.

(3.)To give a little back ground I have run a c++ program and made a
driver before using GCC on a TS-3300. Is there a similar development
environment on the BB?

You can just open the serial port tty.

(4.) Lastly can Anyone make a demo for a program that runs directly on
boot up. So that when the SBC is powered on it goes directly into a c
program? I am not sure if anyone has done this with the board yet?

Sorry I know there are many similar posts and examples out
there...unfortunately I am still running into some issues. Thanks for
any help in advance!

I'm not sure if it is so helpful, but for people not so familiar with
embedded development, I've been introducing them to Beagle with native
development. Using the Angstrom demo for my ESC training (see [1]),
it is possible to run 'gcc' natively. The 'boot.sh' file is
automatically executed by the modified ramdisk.gz. It is possible to
edit the script to automatically run your program, rather than to
execute the commands it is currently setup to do (flash your board).

Also, it doesn't hurt to go through some basic Linux training[2]. The
Free-Electrons courses have some free materials to help get you
started.

[1] ESC Build Your Own Embedded System online registration deadline 3/25 - BeagleBoard
[2] Embedded Linux, kernel, drivers, Yocto, Buildroot and graphics training

QUESTIONS:
First off I am using windows and I have had the same results running
vmware linux ubuntu 8.10

(0.) I have been trying to get the code Sorcery compiler to work but I
have run into some issues. Is it free?..because I cannot get this to
work.

http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

When I install CODE Sorcery it does not install an executable it just
installs documentation and an uninstaller. Does the free version have
a graphical user interface?...With that said can someone write a
tutorial for setting up a c compiler for the BB system it would be
greatly appreciated to have a hello world program that is simple and
straight forward. So how do I get it to run. Should I be using
CodeComposer Studio with Eclipse?...or should I be using some other
library to develop with Eclipse?

I believe that Code Sourcery does not come with a GUI unless you buy it.

(1.) Is this possible with the drivers that are already available on
the board/ Or should I write Some new drivers?

You mentioned that the other board sent serial data over USB, and I'm not certain what you mean by that. Does the other board have a serial output port on it? If so, you can plug it into the Beagle serial port and then Beagle apps could read the data.

(2).If I need to write drivers what is the best free environment for
writing drivers? Also is there a c++ compiler already on the BB board
when using the angstrom setup...and if so how is it accessed and where
can I find info on the libraries it uses? Also is there a hello world
tutorial for it.

My preference for Beagle development is a cross-compiler that runs under Linux (Ubuntu works well) on a PC (not on the Beagleboard). Cross-compilation is a lot faster than compiling on the beagle directly.
I''m using the OpenEmbedded build system to download and build the entire dev environment, but I think CodeSourcery installs the same basic compilers and tools, and it seems to be a lot faster to set up if you don't need to rebuild the whole kernel.

Once the cross-compiler is installed, you can compile via the command line using gcc, or you can install the free eclipse development GUI and use that. In either case, to make a PC linux system compile code that will run on the beagle, if will be simplest if you set two environment variables:
CROSS_COMPILE=arm-none-linux-gnueabi-
ARCH=arm

CROSS_COMPILE is used by many tools and in Makefiles as a prefix, so that it actually runs "arm-none-linux-gnueabi-gcc" instead of plain "gcc".

I've been going through the process of getting my dev environment set up for a project on the beagle, and it wasn't too bad, although it has been years since I used Unix and I've never done cross-compiled stuff before. If you'd like more details on exactly the steps I went through, let me know.

(3.)To give a little back ground I have run a c++ program and made a
driver before using GCC on a TS-3300. Is there a similar development
environment on the BB?

If you have compiled stuff under Linux with GCC, then it will not be much different compiling stuff for the beagle, once you have the cross-compilers installed. For example, if you do:
arm-none-linux-gnueabi-gcc test.c -o test
it will compile the test.c app into an executable that will run on the Beagle.

(4.) Lastly can Anyone make a demo for a program that runs directly on
boot up. So that when the SBC is powered on it goes directly into a c
program? I am not sure if anyone has done this with the board yet?

You can modify the unix startup scripts so that your app is started automatically on boot. I haven't looked at the beagle startup yet, but most Linux systems have a set of scripts in /etc/init.d that are run on startup. You could either modify one of these scripts or add an additional script. It isn't too hard, but the number of different scripts can be confusing at first. If you want specific help, just ask. I don't have the beagleboard in front of me right now, so I can't give precise info here.

Brett

Thanks for all the great info.

(1.) I would be interested in learning how you use open embedded as a
development environment I have tried multiple times to setup OE in the
VMWARE Ubuntu 8.10 and had an error occur...The error is supposedly
due to the lack of a properly setup cache variable. I followed this
tutorial

http://elinux.org/BeagleBoardAndOpenEmbeddedGit

The Error occurs at the end of <<<<<<<<<<<<<<this statement in the
described tutorila

Pull down any changes in the git tree.

cd $OE_HOME/openembedded
git pull
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
git checkout

Let me know if you are using a different method to obtain
OE...possibly from a different tutorial...

2.) Has Anyone Create a working eclipse environment for the BB. And if
so Can they give a tutorial that actually works to set it up. OR even
better provide a zip file that is everything ready to go for vista?

In what I meant by virtual comm port is that when I plug the usb
adapter into a host computer the usb port shows up as say com 3 or com
x you know what I mean in a terminal program. No actual db9 connector
only usb connectors. Anyways that is what I meant by virtual comm
port. I brought this up because I know if the drivers are setup
correctly it would be no problem to send two 115200 serial streams
over one usb port with a band width of 240mbs. Obviously there is
plenty of BW for both the serial lines to make it to the BB
concurently. I am just wondering if it is possible for me to deal with
both of the serial ports in a c program at the same time.

Thanks again for the help!

Thanks for all the great info.

(1.) I would be interested in learning how you use open embedded as a
development environment I have tried multiple times to setup OE in the
VMWARE Ubuntu 8.10 and had an error occur…The error is supposedly
due to the lack of a properly setup cache variable. I followed this
tutorial

http://elinux.org/BeagleBoardAndOpenEmbeddedGit

I use andLinux, which runs under (actually “beside”) Windows, and works very well for this. It gives me a full Ubuntu environment running at the same time as Windows, and Linux windows can be intermixed with regular windows (unlike VMWare, where there is a separate “master” window that all of the Linux windows appear in as subwindows).

You can get andLinux here:
http://www.andlinux.org/

It has an installer and the process goes pretty smoothly. After I installed andLinux, I was able to follow the elinux.org OpenEmbedded instructions and it worked fine.

2.) Has Anyone Create a working eclipse environment for the BB. And if
so Can they give a tutorial that actually works to set it up. OR even
better provide a zip file that is everything ready to go for vista?

In the andLinux system I was able to add Eclipse using the normal Linux package process. I did have to also install Sun’s Java runtime, since Eclipse doesn’t work so well with the default GCJ java.

In what I meant by virtual comm port is that when I plug the usb
adapter into a host computer the usb port shows up as say com 3 or com
x you know what I mean in a terminal program. No actual db9 connector
only usb connectors. Anyways that is what I meant by virtual comm
port. I brought this up because I know if the drivers are setup
correctly it would be no problem to send two 115200 serial streams
over one usb port with a band width of 240mbs. Obviously there is
plenty of BW for both the serial lines to make it to the BB
concurently. I am just wondering if it is possible for me to deal with
both of the serial ports in a c program at the same time.

So the device you are connecting to is a USB device (with a USB connector) that directly plugs into the PC? And at that point the device appears as a serial port, even though it is really something else? If so, to make the device work on the Beagleboard, you’d need to have at least a Linux USB driver for the serial port chip that is in your USB device. I haven’t gone looking for this sort of thing, but if it uses standard serial hardware I’d think there was a good chance that a driver exists.
Do you have one device that shows up as two serial ports, or do you want to connect two of the devices?

Brett

Thanks that sounds good I will start trying to get that together for
OE with andLinux.

There are two separate usb plugs that are going into a hub that act
like serial ports. This all works in vista but I will have to see how
it goes in angstrom once I figure out how to get these compilers
working....

Speaking of which you said that you have gotten eclipse working in
andLinux. Did you use the full install or did you use the C++
install??? from

http://www.eclipse.org/downloads/

I am assuming you used the third one down?

have you figured out how to get the crosstoolchain compiler to work
and if so...
1.where did you download the cross toolchain from?
2.how did integrate the cross toolchain with linux to compile for the
beagle board?
3.Did you get a successful compile in c++ for the beagle? if so do you
have an example program you have run?
4.Can you provide some steps for getting all of these things setup in
the Eclipse environment.

Thanks for the help I will try that other version of linux.

Speaking of which you said that you have gotten eclipse working in
andLinux. Did you use the full install or did you use the C++
install??? from

http://www.eclipse.org/downloads/

I am assuming you used the third one down?

The easiest way to install eclipse (or any other package) in linux is using ‘apt-get’. As root, do:
apt-get install eclipse

That will automatically download and install eclipse and all the stuff it requires.

You will want to install Sun’s Java first, since the default GCJ Java doesn’t work well with Eclipse. I followed the instructions for that here:
http://www.ubuntugeek.com/how-to-install-and-setup-eclipse-with-suns-java.html

If you don’t already know Linux, it will take a while to get the hang of all the pieces. But when you do it is quite a good development environment.

have you figured out how to get the crosstoolchain compiler to work
and if so…
1.where did you download the cross toolchain from?

I built it using OpenEmbedded.

2.how did integrate the cross toolchain with linux to compile for the
beagle board?

I set my PATH enviroment to point to the compiled OE files, set the CROSS_COMPILE and ARCH environment variables I mentioned previously, and then used (for example):
arm-angstrom-linux-gnueabi-gcc -o test test.c

3.Did you get a successful compile in c++ for the beagle? if so do you
have an example program you have run?

I have not compiled c++, but i believe that you could do pretty much the same a C, but using “arm-angstrom-linux-gnueabi-g++”

4.Can you provide some steps for getting all of these things setup in
the Eclipse environment.

Just use the above-mentioned compiler in your eclipse projects, and the executables produced should run on the beagle.

Brett

I set my PATH environment to point to the compiled OE files, set the
CROSS_COMPILE and ARCH environment variables I mentioned previously...

(1)environment variables:
   CROSS_COMPILE=arm-none-linux-gnueabi-
   ARCH=arm

...and then used (for example):
arm-angstrom-linux-gnueabi-gcc -o test test.c

I am new to the Path thing I am assuming you mean to put (1) exactly
as it is written into a text file such as (/File) and then link it to
the path by type the following at the console prompt. Path=$PATH:/
File Is that a correct assumption or should I go into a certain file
and add those three lines exactly as they are written above to an
existing file. If this is the case what is the name of that file?

Where are these environment variables available to be edited at? I
guess I need to compile those OE Files first...but I don't really know
what you mean by

I set my PATH environment to point to the compiled OE files

Im not sure what the above means

I installed andLinux and it is giving me an error "Could not launch
"KWord": could not conncet to 192.168.11.150:81 I am not sure why it
is doing this when I try to open the console but I will look
into...just thought I would throw that out while I was typing

Thanks for your help! as you can tell I am a little new to this.