How to install ChibiStudio on Mac OSX

Here is a brief guide about installing ChibiStudio 2.6.7 on Mac OSX 10.10. Please note that this is the first draft of the guide, so it may contain inaccuracies or errors.

  1. Install the Command Line Tools (if you haven’t already installed it) by typing “xcode-select –install” in a terminal window and click the “install” button on the popup that will appear.
  2. Install Eclipse Luna IDE for C/C++ Developers (you can download it from “https://www.eclipse.org/downloads/“). Eclipse comes in a .tar.gz package - you can extract it in your Application folder.
  3. Install GDB hardware debug support - in Eclipse select the “Help”→”Install New Software” menu. Then click the “Add” button and type “CDT” in the name box and “http://download.eclipse.org/tools/cdt/releases/8.5“ in the “Location” box. Click OK. Then in the “Work with” box you should see “CDT - http://download.eclipse.org/tools/cdt/releases/8.5” - otherwise select it manually
  4. In the pane below the “Work with” box expand the “CDT Optional Features” branch and select “C/C++ GDB Hardware Debugging” and Click “Next>”, click “Next>” again, accept the licensing terms and click “Finish”.
  5. Download and install the GCC ARM Embedded toolchain for Mac (https://launchpad.net/gcc-arm-embedded). If you have no idea of where to install it then a good place could be in subfolder under the Eclipse folder - simply unpack it and copy its main folder under eclipse.
  6. Download, build and install OpenOCD 0.8.0 (you can get it from “http://sourceforge.net/projects/openocd/files/openocd/“). It needs MacPorts or Homebrew - check the README.OSX file in the openocd directory for more information. To configure the build use: “LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include ./configure –enable-stlink –enable-ftdi” (for MacPorts) or ”./configure –enable-stlink –enable-ftd” (for Homebrew). Then use “make all” to build openocd. When it ends copy openocd executable from the src folder to the tcl folder.
  7. Create a folder named “ChibiStudio” in your home folder (or in another place according to your preferences) then create two sub-folders under it: there first will be named “ChibiOS” and the second “workspace” (both sub-folders must be directly under ChibiStudio).
  8. Download ChibiOS_2.6.7.zip from “http://sourceforge.net/projects/chibios/“ and extract it from the zip. Copy the content of the ChibiOS_2.6.7 folder into the ChibiStudio/ChibiOS folder you previously created.
  9. Run Eclipse and select the “ChibiStudio/workspace” directory you previously crated as current workspace.
  10. Choose “Import…” from the “File” menu. Then select “General→Existing project into workspace” and click “Next>”. Select “ChibiStudio/ChibiOS” as root directory and tick “Search for nested projects”, then click “Next>” and import everything.
  11. For each imported project open the properties window (right mouse button on the project name in project explorer, then select “Properties”) and add:
    1. the following linked resources (in “Resources→Linked Resources”):
      1. CHIBIOS, which points to the ChibiOS folder you created at point 7
      2. CHIBI_STUDIO, which points to the ChibiStudio folder you created at point 7
    2. the following environment variable (in “C/C++ Build→Environment”)
      1. PATH, which value is ”/usr/bin:/bin:/usr/sbin:/sbin:<path to gcc-arm-none-eabi bin folder you installed at point 5>”; for example ”/usr/bin:/bin:/usr/sbin:/sbin:/Applications/eclipse/gcc-arm-none-eabi-4_8-2014q3/bin” if you installed GCC for ARM embedded in the /Applications/eclipse/ folder.
  12. Configure OpenOCD from the”Run→External Tools→External Tools Configurations…” menu. Then click on “Programs” then click the New button (i.e. the one with a blank sheet with a “+” in the upper right corner) and type “OpenOCD on STLink v2-1 tool” in the name field.
    1. In the “Main” pane:
      1. In the “Location:” box type the openocd executable file name with the complete path starting from from / (e.g. “/Application/OpenOCD/tcl/openocd” in the case openocd executable is located in the “/Application/OpenOCD/tcl/“ directory).
      2. In the “Working Directory” box type the name of the directory which contains the openocd executable with the complete path starting from from / (e.g. “/Application/OpenOCD/tcl” in the case openocd executable is located in the “/Application/OpenOCD/tcl/“ directory).
      3. In the “Arguments:” box type: -c “telnet_port 4444” -f “interface/stlink-v2-1.cfg” -f “${file_prompt}”
    2. In the “Build” pane untick “Build before lanuch”.
    3. In the “Common” pane tick “External Tools” in the “Display in favourites menu” box.
    4. Click the “Close” button.
  13. Configure GDB from the “Run→Debug configuration…” menu. Click on “GDB Hardware Debugging” then click the New button (i.e. the one with a blank sheet with a “+” in the upper right corner) .
  14. Configure the debugging session from the “Run→Debug configurations…” menu (This should be done for each project).
    1. Select “GDB Hardware Debugging” and Click on the “New” icon (or left mouse button for the context menu and select “New”).
    2. In the “Main” pane type:
      1. ”./build/ch.elf” in the “C/C++ Application:” box;
      2. The name of the current project in the “Project:” box;
    3. In the “Debbuger” pane:
      1. type the path to “arm-none-eabi-gdb” (e.g. ”/Application/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gdb” in the case arm-none-eabi-gdb executable is located in the “/Application/gcc-arm-none-eabi-4_8-2014q3/bin/“ directory);
      2. tick “Use remote debbuger”;
      3. select “Generic TCP/IP” as “JTAG device”;
      4. type “localhost” in the “Host name or IP address:” box;
      5. type “3333” in the “Port number:” box;
    4. In the “Startup” pane:
      1. tick and type “1” in the “Reset and Delay (seconds):” box;
      2. tick “Halt”;
      3. in the “Initialization commands” box type:
        		set remotetimeout 20
        		monitor reset init
        		monitor sleep 50
      4. tick “Load image” and select “use project binary:”;
      5. tick “Load symbols” and select “use project binary:”;
      6. tick “Set breakpoint at:” and type “main” in its box;
      7. tick “Resume”
    5. In the “Common” pane tick “Debug” in the “Display in favourites menu” box.
 
chibios/community/setup/chibistudio_mac.txt · Last modified: 2015/03/29 22:29 by giogog
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.3