nR52840 DK CMake Blinky is yet another blinky project, but it was created with a clear goal in mind: learning the usage of CMake and the cross-compilation build process.
This project can be used as a reference for people that want to learn how to cross-compile without the usage of an IDE. A companion series of blog posts explaining the reasoning process will be added later and linked to this page.
The project supply the source code and the structure to compile a blinky project for the nRF52840DK development board from Nordic. In particular, the project is compiled using CMake (with the help of a Makefile shim) and the nrfx
module, from the nRF5 SDK.
The main project goals are:
- learn the software build process
- learn the usage of CMake for cross-compilation
- avoid the usage of an IDE
- provide a working project template for more advanced applications
The project is still under development. Code versioning follows the git flow standard.
The main app is always the blinky program, but in each major version the implementation evolves. In particular:
- v1 → basic blinky implementation using a wait function;
- v2 → use the TASK/EVENT logic available in the nrfx module.
These instructions will get you a copy of the project up and running on your local machine for development purposes.
You need to install the following dependencies to correctly compile and flash the project
In addition, you will also need the nRF52840 DK board.
The project source code is hosted on GitHub. You can clone the project using this command:
git clone [email protected]:damianolodi/nrf52840dk-cmake-blinky.git
The project provides a Makefile shim to ease the usage of CMake. The most useful targets are the following.
# Cross-compile for nRF52840
make CROSS=nRF52840
# Flash program onto the board
make flash
# Clean compiled files
make clean
# Remove the _build directory
make distclean
A companion series of blog posts explaining the reasoning process will be added later and linked to this page.
This project is licensed under the MIT License - see LICENSE.md file for details.
The skeleton for this project is a stripped-down version of a more complete project skeleton, published using the Apache 2.0 license. The build systems files were modified to match the build requirements of this project. The
In addition, the following libraries were included from the source code of the nRF5 SDK and all copyright notices were maintained:
- all files from
src/lib/nrfx
- all files from
src/lib/cmsis
- all files from
src/utility/nrf_delay
- file
src/app/pca10056.h
Damiano Lodi - Journey to Engineering
- Phillip Johnston - Main skeleton creation and support - Embedded Artistry
The skeleton of this project is a stripped-down version of a more complete version made by Phillip Johnston. His complete project skeleton can also be found on GitHub. I would like to thank him for the support and advice he gave me during the project development.
If you want to learn CMake and how to build a more complete skeleton, my suggestion is to follow the courses made by him about this topic