Table of Contents generated with DocToc
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! :)
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.
Before starting, please make sure you have those installed:
- Arduino IDE 1.0.x or 1.6.x - Download the app from the website
- Homebrew - Follow the instructions on their website
- Git - use
brew install gitto install the latest version
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 arduinoWe've made a Homebrew formula that you can tap like dat ass:
$ brew tap osx-cross/avr
$ brew install avr-libc
$ brew install avrdudeCheck that everything has been installed properly by running avr-gcc -v and avrdude -v.
$ sudo apt-get install gcc-avr binutils avr-libc avrdudeMake sure everything is up and running by running avr-gcc -v and avrdude -v.
Simply clone the repo:
$ cd ~
$ git clone https://github.com/ladislas/Bare-Arduino-Project MyArduinoProjectInitialize and update submodules:
$ cd MyArduinoProject
$ git submodule update --init --recursiveCreate a Github repository and push to it:
$ git remote set-url origin https://github.com/{{YOUR GITHUB USERNAME}}/MyArduinoProject
$ git push --set-upstream origin masterTo 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, you can install it using Homebrew on OS X:
$ brew install pythonThen install pySerial:
$ pip install pyserialTo 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/FooProjectThen 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 ./MakefileModify the Makefile to suit your needs:
PROJECT_DIRis the full path to the root project folder (ex.PROJECT_DIR = $(HOME)/MyArduinoProject).BOARD_TAG&BOARD_SUBdefine the target board you are compiling to.BOARD_SUBis 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 defitions file (see
BOARDS_TXTpath whenmakeis 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 = proandBOARD_SUB = 8MHzatmega328
- Open the board defitions file (see
MONITOR_PORTis the device full path (required if you want to upload to the board). An example is/dev/tty.usbserial-A20356BI
Then compile and upload your code to an Arduino Uno:
$ make
$ make uploadIf 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.