Skip to content

fix: CMake build producing too large binaries #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ target_compile_options(bootloader PUBLIC
-Wmissing-format-attribute
-Wno-endif-labels
-Wunreachable-code
-Os
# Suppress warning caused by SDK
-Wno-unused-parameter -Wno-expansion-to-defined -Wno-array-bounds
)
Expand Down Expand Up @@ -333,4 +334,4 @@ add_custom_target(flash-mbr

add_custom_target(flash-erase
COMMAND ${NRFJPROG} -f nrf52 --eraseall
)
)
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,20 @@ You must have have a J-Link available to "unbrick" your device.

### 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
cd Adafruit_nRF52_Bootloader
git submodule update --init
```

#### Build using `make`
Then build it with `make BOARD={board} all`, for example:

```
Expand All @@ -137,6 +143,21 @@ Supported boards are: feather_nrf52840_express feather_nrf52840_express pca10056
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

To flash the bootloader (without softdevice/mbr) using JLink:
Expand Down
Loading