Sunday, October 6, 2013

Develop ARM Cortex-M on Mac OSX (3)

  If you have followed my previous posts, you have arm gcc and appropriate project setups. Unfortunately, my eclipse is not working. So, I will be using Netbeans.

Today's procedure:
  1. Install Netbeans
  2. Setup Netbeans for arm gcc
  3. Compile ChibiOS
Okay, let's start!

1. Install Netbeans on Mac OSX. This part is easy. Download the binary package of C++ IDE from netbeans.org then install it. move the extracted folder to "/Applications" folder.

   2. Setup netbeans so that it can use arm gcc. Just like you do in eclipse, netbeans also needs PATH. 
Open preference by cliking Netbeans->Preference or press "[command] [,]"
Select C/C++->Build Tools

Your screen should look like this.



 Press [Add...] button


Press [Browse] button, then locate the bin folder.
Path: /Users/richpk21/Developer/Yagarto/yagarto-4.7.2/bin


Name the tool collection as "yagarto".
I already have a name "yagarto", thus I'm using a name "yagarto_2" for this tutorial.
Click [OK] button to finish adding a tool collection.


Set c, c++, as compiler path which are in the yagarto bin folder.
/Users/richpk21/Developer/Yagarto/yagarto-4.7.2/bin/arm-none-eabi-gcc
/Users/richpk21/Developer/Yagarto/yagarto-4.7.2/bin/arm-none-eabi-c++
/Users/richpk21/Developer/Yagarto/yagarto-4.7.2/bin/arm-none-eabi-as



Click [OK] button to finish setting tool name.



Next, we will set PATH for arm gcc.
Navigate to:
/Applications/NetBeans/NetBeans 7.3.1.app/Contents/Resources/NetBeans/etc 

Use
 sudo vim netbeans.conf

Add this to a new line:
PATH=/bin:/usr/bin:/usr/local/bin:/Users/richpk21/Developer/Yagarto/yagarto-4.7.2/bin

Save it by typing this in command mode:
:wq

Now, quit the Netbeans and relaunch it.




   3. Now, it is time to load the project and compile it.
Just like my last post, relocate project folder and chibios folder. If you have not done it, here is how:


copy  ~/workspace/ChibiOS/demos/ARMCM3-STM32F103
to       ~/workspace/ARMCM3-STM32F103
and then
copy  ~/workspace/ChibiOS
to       ~/workspace/ARMCM3-STM32F103/ChibiOS



After the project folder modification, create a new project.


 Select C/C++ -> C/C++ Project with Existing Source


Click the [Browser] button


Select the project folder that we modified. (ARMCM3-STM32F103)


Select yagarto tools that you added.


Use Automatic, unless you want to see what other options it offers chose Custom.








  Now, the arm gcc and the project is set. Build the project by clicking the hammer icon or hammer-and-broom icon. The ChibiOS should be compiled without errors. Start developing real-time os or applications with arm gcc and Netbeans.

Oh, and don't forget to have FUN( )

No comments: