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 (latest version)(1) - Download the app from the website
- Homebrew - Follow the instructions on their website
- Git - use
brew install git
to install the latest version
(1): Follow the requirements of sudar/Arduino-Makefile.
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
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
.
$ 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
.
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
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
Then install pySerial
:
$ python3 -m pip install -U --user pyserial
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 whenmake
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
andBOARD_SUB = 8MHzatmega328
- Open the board definitions file (see
MONITOR_PORT
is 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 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.