[nRF Connect] Provide a way to build examples with no debugging features (#3658)
* [nRF Connect] Provide a way to build examples with no debugging features
- Add configuration overlay with release settings that
disable diagnostic features like shell/application logs
- Add instruction how to you the release config
- Turn overlay-sample-defaults.conf into sample-defaults.conf
and apply it before a project-specific config.
* Restyled by prettier-markdown
* [nRF Connect] Initialize GN's is_debug argument
* [nRF Connect] Disable assertions in release config
Summary of changes in this PR:
| default config | release config
-------+----------------+---------------
FLASH: | 535924 B | 430700 B
SRAM: | 179121 B | 169073 B
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/examples/lock-app/nrfconnect/README.md b/examples/lock-app/nrfconnect/README.md
index ad7b164..207b033 100644
--- a/examples/lock-app/nrfconnect/README.md
+++ b/examples/lock-app/nrfconnect/README.md
@@ -12,6 +12,7 @@
- [Using Docker container](#using-docker-container)
- [Using Native shell](#using-native-shell)
- [Supported nRF Connect SDK versions](#supported-nrf-connect-sdk-versions)
+ - [Building minimal binary](#building-minimal-binary)
- [Configuring the example](#configuring-the-example)
- [Flashing and debugging](#flashing-and-debugging)
- [Accessing the command line](#accessing-the-command-line)
@@ -231,6 +232,18 @@
$ setup --ncs v1.4.0
+### Building minimal binary
+
+In order to build the example with no diagnostic features like UART console or
+application logs, which should result in significantly smaller binary, run the
+following commands:
+
+ # Delete the build directory to make sure that no settings are cached
+ $ rm -rf build/
+
+ # Build the example using release config overlay
+ $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/release.conf
+
<a name="configuring"></a>
## Configuring the example