Saturday, May 25, 2013

Setup arm tool chain for RaspBerry-Pi (with MacOSX host)

Installing the ARM Toolchain

1) Simply download the tool chain package from the link.

https://github.com/downloads/UnhandledException/ARMx/ARMx-2009q3-67.tar.bz2

2) un-tar the package /opt/arm-linux-tools

3) add the tool chain path to the system path env & update the PATH env, e.g.
export PATH=/opt/arm-linux-tools/bin:$PATH

4) This is an option to install the eclipse as a IDE. http://www.eclipse.org/downloads/
Any Eclipse IDE for C / C + + Developers are OK. My version is


Eclipse IDE for C/C++ Developers
Version: Juno Service Release 2


5) After the eclipse, simply go to the HELP menu and checks for the update.

6) Now you could new a C project and set up the cross compile env.

7) Go to the project explorer & select the properties. Set up the cross compiler to "arm-none-linux-gnueabi-" & the cross compiler path.


8) You could add your source codes by New command & then Source File. e.g. main.c

#include
int main(void) {
printf("Hello World!\n");
return 0;
}


9) Then you could compile the program by Build command & verify the compiled codes with command  "arm-none-linux-gnueabi-objdump -t filename" on your host console.

10) You could not run your code in the host as it is a arm executable. 

11) You have to ftp the code to your lovely RPi & you have to setup the ftp server on the RPi but it is not difficult. And then execute the program on the target.



12) You could even setup the remote debugger in the eclipse ^_^


No comments: