This directory contains a CMake toolchain to build and upload a firmware using the HAL system for a board.
Adafruit Feather M0
Make sure you have all prerequisites:
- Install the Arduino IDE, version 1.8.9 or later.
- Install the "Adafruit SAMD Boards" package.
- Install the "Arduino SAMD Boards" package.
- Install CMake version 3.14 or later.
- Install Python version 3.7 or later.
Prepare a project for using the configuration script
python3 configure.pyto create the
feather-m0-config.cmakefile. The script will scan your system for correct paths used for the toolchain.
- Update the
CMakeLists.txtof the project root directory.
Create the build environment:
- Create a new empty directory:
- Change into this directory:
cmakeusing the toolchain. Assuming
~/hal-example-fm0-blinkis the directory of the project and
~/blink-buildis the build directory.
mkdir ~/blink-build cd ~/blink-build cmake -DCMAKE_TOOLCHAIN_FILE=~/hal-example-fm0-blink/hal-toolchain/feather-m0.cmake ~/hal-example-fm0-blink
Build the Firmware
To build the firmware, just run
make from the build directory:
cd ~/blink-build make
Upload the Firmware
To upload the firmware, just run
cd ~/blink-build make install
hal-example-fm0-blink for a working example project:
Notes About IDE Usage
This toolchain creates symlinks in the
arduino-core library to the correct source directories. These directories are created to make editing of projects simpler for IDEs like CLion.
By adding these symlinks, all required files are added at a defined place in the source tree. Without the symlinks, some IDEs (like CLion) will add all files to the project root, which is inconvenient.
This library is a work in progress. It is published merely as an inspiration and in the hope it may be useful.
Copyright 2019 by Lucky Resistor.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.