Skip to content

Latest commit

 

History

History
173 lines (114 loc) · 5.84 KB

INSTALL.md

File metadata and controls

173 lines (114 loc) · 5.84 KB

How to install and use the Bare-Arduino-Project

Table of Contents generated with DocToc

About

You will be guided during the installation and setup of the toolchain.

The toolchain gathers all the pieces of software you need to successfully write, compile, debug, recompile and upload the code of your Arduino projects.

It took us quite some time to figure out what to do, how to do it, which Homebrew formula to install, how to use the Makefile and so on. When we say quite some time, you can count full working weeks of reading, trying, trying again, cursing because nothing is working, dead ends, new ideas, clearer vision and finally a working toolchain.

It's our present to the world!

Have fun! :)

Installation Guide

Important note about bugs and issues

If during or after the installation process, something does not work with the Bare-Arduino-Project, please first report the issue here in this repo issue tracker and not in Arduino-Makefile.

It will allow us to investigate first and not overflow the Arduino-Makefile issue tracker with unrelated issues.

Getting Ready - The Toolbox

OS X

Before starting, please make sure you have those installed:

Linux

Before starting we need to install git and arduino:

# First add the git-core ppa
$ sudo add-apt-repository ppa:git-core/ppa

# Update list
$ sudo apt-get update && sudo apt-get upgrade

# Install git 2.x.x and Arduino 1.0.x
$ sudo apt-get install git arduino

1. Install avr-gcc, binutils, avr-libc and avrdude

OS X

We've made a Homebrew formula that you can tap like dat ass:

$ brew tap osx-cross/avr
$ brew install avr-gcc
$ brew install avrdude

Check that everything has been installed properly by running avr-gcc -v and avrdude -v.

Linux

$ sudo apt-get install gcc-avr binutils avr-libc avrdude

Make sure everything is up and running by running avr-gcc -v and avrdude -v.

2. Clone Bare-Arduino-Project repository from Github

Simply clone the repo:

$ cd ~
$ git clone https://github.com/ladislas/Bare-Arduino-Project MyArduinoProject

Initialize and update submodules:

$ cd MyArduinoProject
$ git submodule update --init --recursive

Create a Github repository and push to it:

$ git remote set-url origin https://github.com/{{YOUR GITHUB USERNAME}}/MyArduinoProject
$ git push --set-upstream origin master

3. Install pySerial

To upload the program, we need to reset the Arduino board. This is done using a python script stored in ./Arduino-Makefile/bin

First, if you don't already have Python 2 & 3, you can install it using Homebrew on OS X:

$ brew install python python@2

Then install pySerial:

$ pip install pyserial & pip2 install pyserial

4. Copy and edit a Makefile

To make sure you're up and running to hack Arduino, we are going to compile some code. We need to have a Makefile for each project we want to compile.

cd to src/FooProject folder:

$ cd MyArduinoProject
$ cd src/FooProject

Then copy the Makefile-Example.mk:

# if you are on OS X
$ cp ../../Makefile-OSX.mk ./Makefile

# or if you're running Linux
$ cp ../../Makefile-Linux.mk ./Makefile

Modify the Makefile to suit your needs:

  • PROJECT_DIR is the full path to the root project folder (ex. PROJECT_DIR = $(HOME)/MyArduinoProject).
  • BOARD_TAG & BOARD_SUB define the target board you are compiling to. BOARD_SUB is only used in the most recent versions of the IDE (and not in Arduino 1.0.x). To find the proper values:
    • Open the board definitions file (see BOARDS_TXT path when make is launched)
    • Find for the board used (for example "Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328")
    • Look at the config keys for this board (in this case pro.menu.cpu.8MHzatmega328=ATmega...)
    • So BOARD_TAG = pro and BOARD_SUB = 8MHzatmega328
  • MONITOR_PORT is the device full path (required if you want to upload to the board). An example is /dev/tty.usbserial-A20356BI

5. Compile and upload your code

Then compile and upload your code to an Arduino Uno:

$ make
$ make upload

If it's not working, make sure everything has been installed correctly and check your Makefile configuration. Also make sure you are using and Arduino Uno.

If nothing seems to help, you can fill an issue here.