Skip to content

Compiling G2 on OS X (with Xcode)

Thomas Kalka edited this page Aug 3, 2017 · 21 revisions

This page is for compiling the G2 project on OS X with XCode. Please see Getting Started with G2 for information about hardware and compiling on other platforms.

See also: Debugging G2 on OSX with GDB and Atmel-ICE

What's needed

To compile G2 on OS X with Xcode you will need to install the free XCode (Download the installer from the Mac App Store or run this command in Terminal: xcode-select --install).

If you wish to use the OS X command line, then visit Compiling G2 on Linux and OS X (command line) as well.

Cloning the git repository

The easiest way on OS X to clone the git repo is probably to use the GitHub OS X app.

  1. Download and install the GitHub app.
  2. Log into the GitHub web site -- register if needed, it's free.
  3. Browse to the G2 project page and then click on the Clone in Desktop button.
  • The GitHub application should open up, and ask where to save the new repository. The default location will probably be sufficient.
  1. In the GitHub app, chose Branches on the left and then click on Edge to checkout the Edge branch.
  2. (Convenience) In the Repository menu, choose Open in Finder to display the folder of the the newly checked out repo.

Compiling

In the newly cloned repo, open the TinyG2 folder, and then open the file named TinyG2.xcodeproj.

Ensure that the TinyG2 scheme is selected, as shown:

TinyG2 Scheme Selected in Xcode

Now you can choose Build for the Product menu of Xcode (or click the "play" button in the top-left of the window) to build G2 for all supported "platforms" simultaneously.

The resulting files will be in ${projectRoot}/TinyG2/bin/, in a folder named after the platform. For example, there will be a folder named gShield with a file named gShield_flash.elf.

Uploading G2 to a target board and Debugging

Clone this wiki locally