Arduino IDE
Arduino 1.0.5
Arduino 1.5.x
Arduino 1.6.x
Arduino 1.0.5
The Arduino IDE (at least since 1.05) has the wonderful
capability of being customizable for new types of hardware.
You can add code that supports pin/port assignments or even
new kinds of processors (such as the xmega) by re-writing
the core libraries and headers and placing them into new
directories within the Arduino environment directories.
Arduino 1.0.5
boards.txt
The most important single file is the 'boards.txt' file, located in the
following directory:
{ARDUINO}/hardware/arduino/boards.txt
ARDUINO 1.0.5
ARDUINO 1.0.5
The prefix ('uno' in this case) is unique for a particular board.
So if you create a new board, you would write a similar
section and add it to 'boards.txt', with 'myboard' (or
whatever) in place of 'uno' at the beginning of each string,
and modify the description accordingly.
ARDUINO 1.0.5
Custom Libraries
Sometimes you will need to customize a standard library for your own use.
Unfortunately this may be due to the fact that, all too often, the libraries
don't support your hardware properly, and/or do NOT have the common
decency to mark members as 'protected' rather than 'private' (forcing you
to edit the library or clone it, rather than creating a derived class).
Fortunately, the Arduino IDE allows you to put your own libraries into a userspecific location:
{SKETCHBOOK}/libraries
Where '{SKETCHBOOK}' is the location of your default sketchbook
repository (as specified in 'preferences').
ARDUINO 1.0.5
Custom Libraries
The Arduino IDE will look in {SKETCHBOOK}/libraries for matching library
names when you '#include' a header file in the main 'INO' (or PDE) file.
So you will always need to specify the header file in the main 'INO' file so
that the Arduino IDE can locate it (along with any source files).
Arduino 1.5.x
Hardware Folders structure
The new hardware folders have a hierarchical structure organized in
two levels:
Arduino 1.5.x
Hardware Folders structure
For example, below we have three hardware vendors called "arduino",
"yyyyy" and "xxxxx":
hardware/arduino/avr/...
hardware/arduino/sam/...
hardware/yyyyy/avr/...
- Yyy - AVR
hardware/xxxxx/avr/...
- Xxx - AVR
the vendor "arduino" has two supported architectures (AVR and SAM),
while "xxxxx" and "yyyyy" have only AVR.
Arduino 1.5.x
Architecture configurations
Each architecture must be configured through a set of
configuration files:
platform.txtcontains definitions for the CPU architecture used
Arduino 1.5.x
Comments
Lines starting with # are treated as comments and will be
ignored
# Like in this example
# -------------------# I'm a comment!
Arduino 1.5.x
platform.txt
The platform.txt file contains information about a platform's specific aspects
(compilers command line flags, paths, system libraries, etc.).
The name will be shown in the Boards menu of the Arduino IDE.
The version is currently unused, it is reserved for future use (probably
together with the libraries manager to handle dependencies on cores).
Arduino 1.5.x
platform.txt
The platform.txt file contains information about a platform's specific aspects
(compilers command line flags, paths, system libraries, etc.).
The name will be shown in the Boards menu of the Arduino IDE.
The version is currently unused, it is reserved for future use (probably
together with the libraries manager to handle dependencies on cores).
Arduino 1.5.x
boards.txt
This file contains definitions and meta-data for the boards
supported. Every board must be referred through its short
name, the board ID. The settings for a board are defined
through a set of properties with keys having the board ID as
prefix.
Arduino 1.5.x
boards.txt
For example the board ID chosen for the Arduino Uno board is "uno".
An extract of the Uno board configuration (in boards.txt file) looks like:
[......]
uno.name=Arduino Uno
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.board=AVR_UNO
uno.build.core=arduino
uno.build.variant=standard
[......]
Arduino 1.5.x
boards.txt
Note that all the relevant keys start with the board
IDuno.xxxxx.
Arduino 1.5.x
boards.txt
The other properties will override the corresponding global
properties of the IDE when the user selects the board. These
properties will be globally available, in other configuration
files too, without the board ID prefix:
uno.build.mcu
=> build.mcu
uno.build.f_cpu
=>
uno.build.board
=> build.board
uno.build.core
=> build.core
uno.build.variant
=> build.variant
build.f_cpu
Arduino 1.5.x
boards.txt
this explains the presence of {build.mcu} or {build.board} in
the platform.txt recipes: their value is overwritten
respectively by {uno.build.mcu} and {uno.build.board}
when the Uno board is selected!
Arduino 1.5.x
boards.txt
Moreover the IDE automatically provides the following
properties:
{build.core.path}
- The path to the selected board's core folder
(for example hardware/arduino/avr/core/arduino)
{build.system.path}
- The path to the selected platform's system folder if available
(for example hardware/arduino/sam/system)
{build.variant.path}
- The path to the selected board variant folder
(for example hardware/arduino/avr/variants/micro)
Arduino 1.5.x
Custom board menus
The board used in the example is the Arduino Duemilanove: this
board was produced in two models one with an ATmega168 CPU and
another with an ATmega328.
Arduino 1.5.x
We have defined two options: "ATmega328" and
"ATmega168".
Arduino 1.5.x
[.....]
## Arduino Duemilanove w/ ATmega328
duemilanove.menu.cpu.atmega328=ATmega328
duemilanove.menu.cpu.atmega328.upload.maximum_size=30720
duemilanove.menu.cpu.atmega328.upload.speed=57600
duemilanove.menu.cpu.atmega328.build.mcu=atmega328p
## Arduino Duemilanove w/ ATmega168
duemilanove.menu.cpu.atmega168=ATmega168
duemilanove.menu.cpu.atmega168.upload.maximum_size=14336
duemilanove.menu.cpu.atmega168.upload.speed=19200
duemilanove.menu.cpu.atmega168.build.mcu=atmega168
[.....]
Arduino 1.6.x
1.6.3
The new Board Manager solves those issues. We had figured
out a way to add custom boards in v1.6.3 of the Arduino IDE,
but it was not officially supported by Arduino. Thanks to the
hard work of Federico Fissore and the Arduino developer
community, we can now add new boards just as easily using
officially supported methods. Let's get started.
Arduino 1.6.x
1.6.4
Version 1.6.4 of the Arduino IDEintroduced official support
for adding third party boards (like the Adafruit Flora and
Trinket) to the new Board Manager. This addition is great
news, because it allows users to quickly add new boards with
the click of a button. Previously the addition of new boards
required a cumbersome manual installation process, or in
certain cases,the download of a completely separate version
of the IDE with the new boards added.
Arduino 1.6.x
Index packet .json format
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.6.x--package_index.json-format-specification
https://
github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-b
oards-support-urls