-
Notifications
You must be signed in to change notification settings - Fork 45
Using external cores with the 1.6.7 architecture
After introducing the 1.6.7 version of the compiler, we can no longer change the include paths used during the compilation because the Arduino-builder uses predefined include paths and tools for each architecture and each variant.
In order for the Arduino-builder to access any core files other than the default ones, the extra files need to be placed in the v167/hardware directory.
At the time of writing this document, three external cores have been used with the 1.6.7 compiler, each of which has to be added in a specific directory. Below you can see the desired structure as it's used in the development version of the compiler, used for compiling chibitronics, microchip chipKit and esp8266 projects. The structure is created in such a way that the fqbn's used in the 1.6.7 codebender compiler are the same as the ones used in the Arduino IDE.
/path/to/arduino-core-files/v167/hardware$ tree -L 4 chibitronics/
chibitronics/
└── hardware
└── esplanade
└── 1.6.0
├── boards.txt
├── cores
├── platform.txt
├── programmers.txt
└── variants
5 directories, 3 files
/path/to/arduino-core-files/v167/hardware$ tree -L 2 chipKIT
chipKIT
└── pic32
├── boards.txt
├── bootloaders.txt
├── compiler
├── cores
├── libraries
├── platformManual.txt
├── platforms.txt
├── platform.txt
├── platformURL.txt
├── tools
├── unsupported_boards.txt
└── variants
6 directories, 7 files
/path/to/arduino-core-files/v167/hardware$ tree -L 2 esp8266/
esp8266/
└── esp8266
├── boards.txt
├── bootloaders
├── cores
├── doc
├── ISSUE_TEMPLATE.md
├── libraries
├── LICENSE
├── package
├── platform.txt
├── programmers.txt
├── README.md
├── tests
├── tools
└── variants
9 directories, 6 files
Follow the steps below in order to end up with this structure.
The core just needs to be cloned in the /v167/hardware directory.
$ cd /path/to/arduino-core-files/v167/hardware
$ git clone https://github.com/xobs/arduino-esplanade.git chibitronicsThe fqbn used for the chibitronics esplanade board is chibitronics:esplanade:code.
For the chipKit core, the respective Github release has been used, but a couple hacks are also necessary in order to use the core. The compiler binary used for chipKit projects is a 32-bit binary file and some extra libraries need to be added to the system in order for the compiler to be executed. Furthermore, a config property is missing from the chipKit board definition and had to be manually added.
$ cd /path/to/arduino-core-files/v167/hardware
$ wget -q https://chipkit.s3.amazonaws.com/chipkit-core/builds/linux64/chipkit-core-linux64.16778040.master-v1.2.0-4-g3088e62.zip
$ unzip -qq chipkit-core-linux64.16778040.master-v1.2.0-4-g3088e62.zip && rm chipkit-core-linux64.16778040.master-v1.2.0-4-g3088e62.zip
$ mv chipkit-core chipKIT
# 32-bit binaries compatibility on 64-bit archs
$ sudo apt-get update && sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0The open the chipKIT/pic32/platform.txt. In the ## Save hex section add the following
recipe.output.tmp_file={build.project_name}.hex
In order to use the esp8266 core, the core files and compilation tools need to be downloaded separately. Also, the boards.txt section referring to the Huzzah Feather needs to be modified. For the record, we are going to use the git version installation, and we will be using version 2.3.0 of the esp8266 core.
$ cd /path/to/arduino-core-files/v167/hardware
$ mkdir esp8266
$ cd esp8266/
$ git clone https://github.com/esp8266/Arduino.git esp8266
$ cd esp8266/
# list available tags
$ git tag -l
$ git checkout tags/2.3.0
# Download binary tools (python 2.7 needed)
$ cd tools/
$ python get.pyIn order to get the Huzzah Feather running, open the boards.txt file found in the esp8266 directory and add the following in the huzzah.build section:
huzzah.build.flash_ld=eagle.flash.4m.ld
Enjoy!