chore: add documentation for CMake
In this repository CMake and Make co-exists. Unfortunately there was no documentation on how to properly use CMake so this is a starting point. Signed-off-by: Andreas Kurz <info@akurz.net>
This commit is contained in:
parent
73020f3567
commit
ddcb2dba8c
1 changed files with 22 additions and 1 deletions
23
README.md
23
README.md
|
|
@ -114,14 +114,20 @@ You must have have a J-Link available to "unbrick" your device.
|
||||||
|
|
||||||
### Build:
|
### Build:
|
||||||
|
|
||||||
Firstly clone this repo with following commands
|
Firstly clone this repo including its submodules with following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone --recurse-submodules -j8 https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
||||||
|
```
|
||||||
|
|
||||||
|
For git versions before `2.13.0` you have to do that manually:
|
||||||
```
|
```
|
||||||
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
||||||
cd Adafruit_nRF52_Bootloader
|
cd Adafruit_nRF52_Bootloader
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Build using `make`
|
||||||
Then build it with `make BOARD={board} all`, for example:
|
Then build it with `make BOARD={board} all`, for example:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -137,6 +143,21 @@ Supported boards are: feather_nrf52840_express feather_nrf52840_express pca10056
|
||||||
Makefile:90: *** BOARD not defined. Stop
|
Makefile:90: *** BOARD not defined. Stop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Build using `cmake`
|
||||||
|
|
||||||
|
Firstly initialize your build environment by passing your board to `cmake` via `-DBOARD={board}`:
|
||||||
|
```
|
||||||
|
cmake -DBOARD=feather_nrf52840_express -S . -B _build -GNinja
|
||||||
|
```
|
||||||
|
|
||||||
|
And then build it with:
|
||||||
|
```
|
||||||
|
cd _build
|
||||||
|
ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use the generator of your choice. For example omit the `-GNinja` and then you can invoke `make` from inside `_build` instead of `ninja`
|
||||||
|
|
||||||
### Flash
|
### Flash
|
||||||
|
|
||||||
To flash the bootloader (without softdevice/mbr) using JLink:
|
To flash the bootloader (without softdevice/mbr) using JLink:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue