Difference between revisions of "Eclipse from Box to Debug"

From Gumstix User Wiki
Jump to: navigation, search
(remove spam)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://esinyqynyso.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://esinyqynyso.co.cc CLICK HERE]=
 +
----
 +
</div>
 
This page is meant to serve as a quickstart guide that takes you from opening an Overo + Expansion out of the Box up to Remote Debugging with Eclipse on Ubuntu.
 
This page is meant to serve as a quickstart guide that takes you from opening an Overo + Expansion out of the Box up to Remote Debugging with Eclipse on Ubuntu.
  
Line 4: Line 12:
 
# sudo apt-get install minicom
 
# sudo apt-get install minicom
 
# sudo minicom -s
 
# sudo minicom -s
# [Serial port setup] -> A - Serial Device -> /dev/ttyUSB0 -> [enter]
+
# [Serial port setup] -&gt; A - Serial Device -&gt; /dev/ttyUSB0 -&gt; [enter]
# [Serial port setup] -> F - Hardware Flow Control -> NO -> [enter]
+
# [Serial port setup] -&gt; F - Hardware Flow Control -&gt; NO -&gt; [enter]
# [Modem and dialing] -> A - Init String -> [empty] -> [enter]
+
# [Modem and dialing] -&gt; A - Init String -&gt; [empty] -&gt; [enter]
# [Modem and dialing] -> B - Reset String -> [empty] -> [enter]
+
# [Modem and dialing] -&gt; B - Reset String -&gt; [empty] -&gt; [enter]
# [Modem and dialing] -> K - Hang-up String -> [empty] -> [enter]
+
# [Modem and dialing] -&gt; K - Hang-up String -&gt; [empty] -&gt; [enter]
 
# [Save as dfl]
 
# [Save as dfl]
 
# [Exit from Minicom]
 
# [Exit from Minicom]
  
== Power & Boot ==
+
== Power &amp; Boot ==
 
# Plug the gumstix into the expansion board
 
# Plug the gumstix into the expansion board
 
# Plug the expansion board into your ethernet router / switch / whatever
 
# Plug the expansion board into your ethernet router / switch / whatever
Line 38: Line 46:
 
     cp -r org.openembedded.dev/contrib/gumstix/build .
 
     cp -r org.openembedded.dev/contrib/gumstix/build .
 
     cp ~/.bashrc ~/bashrc.bak
 
     cp ~/.bashrc ~/bashrc.bak
     cat ~/overo-oe/build/profile >> ~/.bashrc
+
     cat ~/overo-oe/build/profile &gt;&gt; ~/.bashrc
 
     source ~/overo-oe/build/profile
 
     source ~/overo-oe/build/profile
  
Line 59: Line 67:
 
     vim hello.c
 
     vim hello.c
  
     #include <cstdio>
+
     #include &lt;cstdio&gt;
 
      
 
      
 
     int main(int argc, char ** argv) {
 
     int main(int argc, char ** argv) {
       printf("Hello World!\n");
+
       printf(&quot;Hello World!\n&quot;);
 
     }
 
     }
  
Line 101: Line 109:
 
     ssh-copy-id root@192.168.1.150
 
     ssh-copy-id root@192.168.1.150
 
     scp ./hello root@192.168.1.150:/hello #
 
     scp ./hello root@192.168.1.150:/hello #
     ssh root@192.168.1.150 "/hello" # succeeds
+
     ssh root@192.168.1.150 &quot;/hello&quot; # succeeds
     ssh root@192.168.1.150 "gdbserver 192.168.1.100:43276 /hello" # starts remote gdb
+
     ssh root@192.168.1.150 &quot;gdbserver 192.168.1.100:43276 /hello&quot; # starts remote gdb
 
     # use ctrl-z and then bg 1 to background this process, or run it from another ssh session
 
     # use ctrl-z and then bg 1 to background this process, or run it from another ssh session
 
     ~/overo-oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gdb --symbols ./hello.debug
 
     ~/overo-oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gdb --symbols ./hello.debug
Line 114: Line 122:
 
     vim hello.c
 
     vim hello.c
  
     #include <cstdio>
+
     #include &lt;cstdio&gt;
 
      
 
      
 
     int main(int argc, char ** argv) {
 
     int main(int argc, char ** argv) {
       printf("Hello World!\n");
+
       printf(&quot;Hello World!\n&quot;);
 
       char * h;
 
       char * h;
 
       delete h;
 
       delete h;
Line 129: Line 137:
 
http://old.nabble.com/Solution:-Using-Eclipse-CDT-for-Gusmtix-development-tt18251552.html#a18251552
 
http://old.nabble.com/Solution:-Using-Eclipse-CDT-for-Gusmtix-development-tt18251552.html#a18251552
 
and  
 
and  
http://krupets.com/index.php?option=com_content&view=article&id=18&Itemid=20
+
http://krupets.com/index.php?option=com_content&amp;view=article&amp;id=18&amp;Itemid=20
  
 
=== Plugins ===
 
=== Plugins ===

Revision as of 14:38, 23 November 2010


This page is meant to serve as a quickstart guide that takes you from opening an Overo + Expansion out of the Box up to Remote Debugging with Eclipse on Ubuntu.

Setting up Minicom

  1. sudo apt-get install minicom
  2. sudo minicom -s
  3. [Serial port setup] -> A - Serial Device -> /dev/ttyUSB0 -> [enter]
  4. [Serial port setup] -> F - Hardware Flow Control -> NO -> [enter]
  5. [Modem and dialing] -> A - Init String -> [empty] -> [enter]
  6. [Modem and dialing] -> B - Reset String -> [empty] -> [enter]
  7. [Modem and dialing] -> K - Hang-up String -> [empty] -> [enter]
  8. [Save as dfl]
  9. [Exit from Minicom]

Power & Boot

  1. Plug the gumstix into the expansion board
  2. Plug the expansion board into your ethernet router / switch / whatever
  3. Plug in the micro-SD
  4. Plug a mini-usb plug (as you would use with a camera) into the mini-usb port labeled console
  5. sudo minicom -o # disables modem and dialing settings
  6. Plug in the 5v power supply
  7. Watch the system boot

OpenEmbedded [OE] Toolchain on Ubuntu

Official (and Thorough) Documentation

   sudo apt-get install git-core
   cd
   mkdir -p ~/overo-oe/user.collection
   cd ~/overo-oe
   git clone git://gitorious.org/gumstix-oe/mainline.git org.openembedded.dev
   cd org.openembedded.dev
   git checkout --track -b overo origin/overo
   cd ~/overo-oe
   git clone git://git.openembedded.net/bitbake bitbake # just try this again if it hangs up
   cd bitbake
   git checkout 1.8.18
   cd ~/overo-oe
   cp -r org.openembedded.dev/contrib/gumstix/build .
   cp ~/.bashrc ~/bashrc.bak
   cat ~/overo-oe/build/profile >> ~/.bashrc
   source ~/overo-oe/build/profile

The important part:

   bitbake gdb-cross

Gumstix Setup

From the previous step your Gumstix should have started configuring itself and hopefully is done, leaving you at the login prompt

   root
   passwd #(change your password)
   ifconfig # configure as necessary. I assume that your IP address is 192.168.1.150
   opkg install gdbserver

Hello World!

This is all taking place on the Ubuntu system (192.18.1.100)

hello.c

   mkdir ~/overo-oe/Code/
   cd ~/overo-oe/Code/
   vim hello.c
   #include <cstdio>
   
   int main(int argc, char ** argv) {
     printf("Hello World!\n");
   }

Makefile

   vim Makefile
   CGTOOLS = ~/overo-oe/tmp/cross/armv7a
   
   # Compiler and Linker flags
   C_FLAGS += -Wall -g
   CPP_FLAGS += -Iinclude
   LD_FLAGS += -g -lm
   
   # compiler
   CC = $(CGTOOLS)/bin/arm-angstrom-linux-gnueabi-g++ $(C_FLAGS) $(CPP_FLAGS) -c
   LINK = $(CGTOOLS)/bin/arm-angstrom-linux-gnueabi-g++ $(LD_FLAGS)
   STRIP = $(CGTOOLS)/bin/arm-angstrom-linux-gnueabi-strip 
   
   .PHONY: all clean
   all: clean hello
   clean:
        rm hello *.o -rf
   hello: hello.o
        $(LINK) -o hello hello.o
        cp hello hello.debug
        $(STRIP) hello
   hello.o: hello.c
        $(CC) -o hello.o hello.c

Compile

Now we'll compile the program with the debug symbols, strip the symbols, and copy it to the gumstix (192.168.1.150)

   make
   cp ./hello ./hello.debug
   ~/overo-oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-strip ./hello
   
   ./hello # fails because it can't run on your architecture
   ssh-copy-id root@192.168.1.150
   scp ./hello root@192.168.1.150:/hello #
   ssh root@192.168.1.150 "/hello" # succeeds
   ssh root@192.168.1.150 "gdbserver 192.168.1.100:43276 /hello" # starts remote gdb
   # use ctrl-z and then bg 1 to background this process, or run it from another ssh session
   ~/overo-oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gdb --symbols ./hello.debug
   target remote 192.168.1.150:43276
   continue

Debug

Now we can introduce a bug and test again

   mkdir ~/overo-oe/Code/
   cd ~/overo-oe/Code/
   vim hello.c
   #include <cstdio>
   
   int main(int argc, char ** argv) {
     printf("Hello World!\n");
     char * h;
     delete h;
     delete h;
   }

Eclipse

We explore how to use eclipse.

I'm currently grokking through http://old.nabble.com/Solution:-Using-Eclipse-CDT-for-Gusmtix-development-tt18251552.html#a18251552 and http://krupets.com/index.php?option=com_content&view=article&id=18&Itemid=20

Plugins

Update sites and plugins

Configuration

Navigating through menus

Remote Deployment Debugging

Having it somehow all come together to this culminating point