By default, Arduino IDE has limited support mostly for AVR based microcontroller boards but to increase IDE productivity we can install an Arduino core that will help to program different boards. Each family of microcontrollers have different hardware, so they need a separate core to run. Let’s discuss more about the Arduino core and the method to install it.
What Is an Arduino Board Core
Core is a kind of software API necessary for a specific group of microcontrollers to make them compatible with Arduino IDE. For instance, AVR chips are supported by AVR core, which is found in most Arduino boards, unlike Arduino Due which is supported by SAM3X core.
Arduino cores help users to install different libraries and sketches. Core provides us with functions like digitalRead(), analogWrite() and millis(). Since each generation of microcontrollers has unique hardware, each one requires its own core to function. Normally Arduino develops core for its microcontroller boards, but anyone can design core for a specific board.
AVR core in IDE is installed in the following directory: hardware/arduino/avr/cores/arduino folder.
Let’s see how we can install an Arduino core for a board of our choice.
How to Install Arduino Core
Starting from Arduino version 1.6.2 and onwards all Arduino IDEs by default come with AVR boards core installed. Some Arduino boards require an additional core to install or in case we are programming any other microcontroller-based board such as ESP32 we first have to install their respective core.
Most common way of installing an Arduino core is using a tool known as Board Manager of Arduino IDE.
Following are the two main ways of installing Arduino core:
- Installing an Arduino Core using IDE Board Manager
- Installing an Arduino core using .json file
1: Installing Arduino Core using IDE Board Manager
Most of the widely used Arduino boards have pre-installed cores in Arduino IDE. There are a very limited number of Arduino boards whose core we need to install. SAMD Arduino is the series which include MKR boards and if one needs to work with them, they need to install their core first.
First open Board Manager, next click Tools>Boards>Boards Manager or press Ctrl+Shift+B. In IDE 2.0.x it can be opened by selecting the second option on the left side on IDE:
Once the Arduino Board Manager is open, search for the respective Arduino core you require. We will install the SAMD MKR Arduino board core. The desired Arduino core version can be selected from the version list.
Click on Install to download, the download time depends upon the connection speed. After installation is successfully completed an Installed tag will appear in front of the core:
Now we can find new boards under Tools>Boards>Arduino SAMD Boards>Arduino MKR Boards:
2: Install Arduino core using .json File
Like Arduino boards we can also program third party microcontrollers-based boards such as ESP32. To program these boards first we need to install required core files for them. Usually, a specific file written in .json format is used. This file is put under the Additional boards manager URLs in the Arduino IDE Preferences section.
For instance, if we need to add an ESP32 board in an IDE the following file will be used:
To add more than one .json file, separate them using a comma or click the icon on the right side of Additional Board Manager, a new window will pop up where we can write as many files we want.
After adding the .json file a new core for the respective third-party microcontroller will be available in the Boards Manager where it can be easily installed. Like we have added the .json file of ESP32 board now you can see that ESP32 board is available in the Board Manager as shown in image below:
Conclusion
Arduino Core files are necessary to program and interface not only the Arduino boards, but any IDE supported microcontroller-based board such as ESP32. To install Arduino core, we have highlighted two potential methods that can be used: using the Board Manager of IDE or using a third party .json file. This article covers both these methods in detail to add any core in the Arduino IDE.