The most exciting thing about this world is its ever changing quality.

Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Wednesday, April 29, 2009

ARM Cross Compiler on Windows

Instead of using commercial suite such as RealView, I decided to set up my own cross compiler and development enviroment. The target ARM device has a > 2.6 linux kernel running, and host as usual is on Windows.
  • Install Cygwin with gcc packages and other make tools selected.
  • Get the source for cross compiler
Dan Kegel's crosstool project provides a fully automated build script covering plenty of different architectures and compiler versions. The latest stable version can be found at http://www.kegel.com/crosstool/ or svn from googlecode:

svn checkout http://crosstool.googlecode.com/svn/trunk crosstool

There is a good reference on wikipage for other options.
  • Build the cross compiler in your enviroment for your target device
After checking out the source code, you will find several shell scripts named demo-*.sh under /src. Open the file for the architecture you require, in this case ARM, thus I chosed the demo-arm.sh file. This script has one line for each known working toolchain for this architecture. An example of the demo-arm.sh looks like this:

RESULT_TOP=/opt/crosstool
[...]
#eval `cat arm.dat gcc-4.1.0-glibc-2.2.2.dat` sh all.sh --notest
eval `cat arm.dat gcc-4.1.0-glibc-2.3.2.dat` sh all.sh --notest

If you require a gdbserver to build, you need to add --gdb to the end of the eval command. Running this shell script will build the cross compiler and gcc binaries for you under /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin. You will be likely to get errors as crosstool shell script won't support space in windows style directory in your HOME enviroment setting, however with not so helpful error message "...incorrect number of arguments". To get over this, 

$ printenv HOME
/cygdrive/c/Documents and Settings/
$ HOME=/cygdrive/c/DOCUME~1/
$ ./demo-arm-softfloat.sh
  • It seems a neat idea to install remote file system plugins on Eclipse (+ CDT package as I am using C++). It turned out to be quite a hurdle! I will try to post my tuning on Eclipse (on Windows) to use the cross compiler we just had and transfer binary across to remote Linux OS.

Thursday, March 12, 2009

Google app engine and all the jazz - Part I

It should not be too difficult to set up the development environment for google application engine. Since at the moment GAE only supports python as its compilation platform, and Eclipse is argubaly the most popular open source IDE with its nice plugin architecture, I decided to set out for the fun. After a beer and an hour effort, I found out Google has a post about the pretty much same setup :-).

First of all, to get Pydev installed in your Eclipse and you might also want to avoid problems in receiving console input while you are working under windows os by override the input() and raw_input() with the following functions:

def win_raw_input(prompt):
    return raw_input(prompt).replace("\r", "")

def win_input(prompt):
    return eval(win_raw_input(prompt))

Also should you want to be able to use console in Eclipse the same way as the interactive shell in python IDLE, here is the link to do so by setting up external tools. Now you can use Eclipse to do your python coding.

I am not going to repeat what has been described by Google's post. There are couple of other things though. Sometimes you will see this error by following the last step by adding user-defined starter for GAE development server using "${project_loc}/src".

This is caused by the fact that the project you are working get its focus snitched by Eclipse IDE.  I got annoyed after a few instances and decided to replace ${project_loc} with ${workspace_loc}\my_project_name\. Just to be aware that your yaml file should be located under your project root folder to allow dev_appserver to pick it up.

The other way is to use external tools to set up a configuration, i.e. "run Python for GAE". In the main tab of the program configuration, add the following parameters:

"C:/Program Files/Google/google_appengine/dev_appserver.py" 
--port=8080
"${workspace_loc}\HelloGAE\"
--port=8080

Now I am all set to rock and roll.