Cmake script for projects targeting Nordic Semiconductor nRF5x series devices using the GCC toolchain from ARM.
# Dependencies
The script makes use of the following tools:
- nRF5x SDK by Nordic Semiconductor - SoC specific drivers and libraries (also includes a lot of examples)
- JLink by Segger - interface software for the JLink familiy of programmers
- nrfjprog by Nordic Semiconductor - Wrapper utility around JLink
- arm-non-eabi-gcc by ARM and the GCC Team - compiler toolchain for embedded (= bare metal) ARM chips
# Setup
1. Download this repo (or add as submodule) to the directory `cmake-nRF5x` in your project
1. Search the SDK `example` directory for a `sdk_config.h`, `main.c` and a linker script (normally named `<project_name>_gcc_<chip familly>.ld`) that fits your chip and project needs.
1. Copy the `sdk_config.h` and the project `main.c` into a new directory `src`. Modify them as required for your project.
1. Copy the linker script into the root of your project. Rename it to just `gcc_<chip familly>.ld` For example:
```
gcc_nrf51.ld
gcc_nrf52.ld
```
1. Create a new `CMakeLists.txt` file at the same level. Add the project standard cmake project header
A typical file may look like this:
```
cmake_minimum_required(VERSION 3.6)
set(NRF_TARGET "nrf52")
# optional, won't be used if passing toolchain on command line (see below)
but if you do so you must ensure the toolchain binaries are available in your environment PATH (i.e. work on the command line without specifying absolute path)