Arduino Ide Port - Help


kingoddball

Well-Known Member
Joined
Oct 26, 2009
Messages
1,686
Hi There,
I have started work on porting Arduino IDE to ARM.
I just can not get XCode to have ARM in the "Architecture". I get i686, X86_64 and PPC. the Basic 3. I have followed online instructions, but failed. Too old I think.

After reading thru the make.sh I seems as tho the LINUX version won't build without "Java 1.5.0_15 JDK (not a JRE,
and not any other version)". Is there a version of this designed for ARM?
I know that ARCH="i686" will have to be changed, I just have to work all that shit out..
I cant get X-Code 3.2.1 to cross compile for ARM.. Any clues????????

I built a working app for OSX using terminal (using make.sh) and it's fine. Although oddly enough the copy I made is 203MB, yet from the website it 80MB.
Make.Sh code is in the Spoiler tab. :pandora2ut4:
I may have bit off more than I can chew.. I'm Shit at this.

#!/bin/sh


### -- SETUP WORK DIR -------------------------------------------

if test -d work
then
BUILD_PREPROC=false
else
echo Setting up directories to build for Linux...
BUILD_PREPROC=true

mkdir work
cp -r ../shared/lib work/
cp -r ../shared/libraries work/
cp -r ../shared/tools work/

cp -r ../../hardware work/

cp ../../app/lib/antlr.jar work/lib/
cp ../../app/lib/ecj.jar work/lib/
cp ../../app/lib/jna.jar work/lib/
cp ../../app/lib/oro.jar work/lib/
cp ../../app/lib/RXTXcomm.jar work/lib/

echo Copying examples...
cp -r ../shared/examples work/

echo Extracting reference...
unzip -q -d work/ ../shared/reference.zip

cp -r dist/tools work/hardware/
cp dist/lib/librxtxSerial.so work/lib/

install -m 755 dist/arduino work/arduino

ARCH=`uname -m`
if [ $ARCH = "i686" ]
then
echo Extracting JRE...
tar --extract --file=jre.tgz --ungzip --directory=work
else
# echo This is not my beautiful house.
# if [ $ARCH = "x86_64" ]
# then
# echo You gots the 64.
# fi
echo "
The Java bundle that is included with Processing supports only i686 by default.
To build the code, you will need to install the Java 1.5.0_15 JDK (not a JRE,
and not any other version), and create a symlink to the directory where it is
installed. Create the symlink in the \"work\" directory, and named it \"java\":
ln -s /path/to/jdk1.5.0_15 `pwd`/work/java"
exit
fi
fi

cd ../..


### -- BUILD CORE ----------------------------------------------


echo Building processing.core

cd core

#CLASSPATH="../build/linux/work/java/lib/rt.jar"
#export CLASSPATH

perl preproc.pl
mkdir -p bin
../build/linux/work/java/bin/java \
-cp ../build/linux/work/java/lib/tools.jar \
com.sun.tools.javac.Main \
-d bin -source 1.5 -target 1.5 \
src/processing/core/*.java src/processing/xml/*.java
#find bin -name "*~" -exec rm -f {} ';'
rm -f ../build/linux/work/lib/core.jar
cd bin && zip -rq ../../build/linux/work/lib/core.jar \
processing/core/*.class processing/xml/*.class && cd ..

# back to base processing dir
cd ..


### -- BUILD PDE ------------------------------------------------

cd app

rm -rf ../build/linux/work/classes
mkdir ../build/linux/work/classes

../build/linux/work/java/bin/java \
-cp ../build/linux/work/java/lib/tools.jar \
com.sun.tools.javac.Main \
-source 1.5 -target 1.5 \
-classpath ../build/linux/work/lib/core.jar:../build/linux/work/lib/antlr.jar:../build/linux/work/lib/ecj.jar:../build/linux/work/lib/jna.jar:../build/linux/work/lib/oro.jar:../build/linux/work/lib/RXTXcomm.jar:../build/linux/work/java/lib/tools.jar \
-d ../build/linux/work/classes \
src/processing/app/*.java \
src/processing/app/debug/*.java \
src/processing/app/linux/*.java \
src/processing/app/preproc/*.java \
src/processing/app/syntax/*.java \
src/processing/app/tools/*.java

cd ../build/linux/work/classes
rm -f ../lib/pde.jar
zip -0rq ../lib/pde.jar .
cd ../../../..


echo
echo Done.
 
The JDK is needed to build Java applications, it usually isn't needed to run them. You can just install the JDK on your desktop, build on there, and copy the resulting files to the Pandora and stuff.
Is the Arduino IDE a native program, or is it entirely Java? Obviously some components are Java, but I wonder if there's any native programming that needs to be investigated before a proper ARM build can be made.
 
Hi Wiz,
Thanks for your help.
After looking around, the wiki is saying that the IDE was written in JAVA.
Throughout the source code that I have, there are many .c and .h files.
Extract:

The Arduino IDE is a cross-platform application written in Java which is derived from the IDE made for the Processing programming language and the Wiring project.


I have installed GCC Arm-elf toolchain? Not sure what any of this means.
http://www.yagarto.de/#downloadmac
My knowledge of programming was nice and easy, use an IDE, click build. None of this extra cross compile or anything.
Why cant someone just make an IDE that builds to ARM directly (that is free) :angry:
 
kingoddball said:
Hi Wiz,
Thanks for your help.
After looking around, the wiki is saying that the IDE was written in JAVA.
Throughout the source code that I have, there are many .c and .h files.
Extract:

The Arduino IDE is a cross-platform application written in Java which is derived from the IDE made for the Processing programming language and the Wiring project.


I have installed GCC Arm-elf toolchain? Not sure what any of this means.
http://www.yagarto.de/#downloadmac
My knowledge of programming was nice and easy, use an IDE, click build. None of this extra cross compile or anything.
Why cant someone just make an IDE that builds to ARM directly (that is free) :angry:

The IDE is written in java, but to compile the arduino sketches it uses avr-gcc and to upload them it uses avrdude, and gcc and avrdude are written in c.

edit: spelling
 
Last edited by a moderator:
dentrado said:
The IDE is written in java, but to compile the arduino sketches it uses avr-gcc and to upload them it uses avrdude, and gcc and avrdude are written in c.
Ah, so avr-gcc needs to be compiled to ARM, but the IDE should be fine.
kingoddball, you've got some learning cut out for you, and a fair bit of work, I should imagine.
This here is what I use to compile stuff for my BeagleBoard. Download and install this
Most Makefiles have a variable called "GCC" or something like that. Find it, and change it from the default path to the installed location of the Codesourcery version, ie, /opt/arm-2007q3/bin/arm-none-linux-gnueabi-gcc
Then type "make" and see what it does.
 
Last edited by a moderator:
The link you posted up is great.
Is that only for linux?
(OSX user)
I have a copy of Fedora 12 Virtualised and WinXP/Win7 incase I need compatability.
But my Fedora is pretty much just a blue shell.
It's the LiveCD installed to a virtual hard drive. No Dev tools.
 
kingoddball said:
Is that only for linux?
(OSX user)
Oh... uh... hmmm...
Sorry, I can honestly say I have no idea about cross compiling from OS X. The CodeSourcery toolchain doesn't seem to support it. I'm going to have to sign off on this and let someone else take over. Sorry. If you were running Linux of some kind I could easily help you.
 
Last edited by a moderator:
Back
Top