From 34292376b7720d28a9904cc392fc8bfd9910045c Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 22 Mar 2022 13:15:27 -0400 Subject: [PATCH] [EFR32] Add documentation and enable release build (#16524) * Add documentation and enable release build --- .github/.wordlist.txt | 1 + examples/light-switch-app/efr32/README.md | 24 ++++++++++++++++++++++ examples/lighting-app/efr32/README.md | 25 +++++++++++++++++++++++ examples/lock-app/efr32/README.md | 24 ++++++++++++++++++++++ examples/window-app/efr32/README.md | 24 ++++++++++++++++++++++ src/platform/EFR32/CHIPMem-Platform.cpp | 5 +---- 6 files changed, 99 insertions(+), 4 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index db98809f615b97..064a278a6c86b2 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1113,6 +1113,7 @@ showDocumentation shubhamdp SIGINT SiLabs +Silabs's SiliconLabs SimpleFileExFlags SimpleLink diff --git a/examples/light-switch-app/efr32/README.md b/examples/light-switch-app/efr32/README.md index 641b6ddd55882b..9e8d40c8da6d84 100644 --- a/examples/light-switch-app/efr32/README.md +++ b/examples/light-switch-app/efr32/README.md @@ -382,3 +382,27 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see [EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) + +## Building options + +All of Silabs's examples within the Matter repo have all the features enabled by +default, as to provide the best end user experience. However some of those +features can easily be toggled on or off. Here is a short list of options : + +### Disabling logging + +chip_progress_logging, chip_detail_logging, chip_automation_logging + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + +### Debug build / release build + +is_debug + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false" + +### Disabling LCD + +show_qr_code + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false" diff --git a/examples/lighting-app/efr32/README.md b/examples/lighting-app/efr32/README.md index bc802db4cd2b20..bb6b24f113337e 100644 --- a/examples/lighting-app/efr32/README.md +++ b/examples/lighting-app/efr32/README.md @@ -331,3 +331,28 @@ commands to multiples devices at once. Please refer to the [chip-tool documentation](../../chip-tool/README.md) _Configuring the server side for Group Commands_ and _Using the Client to Send Group (Multicast) Matter Commands_ + +## Building options + +All of Silabs's examples within the Matter repo have all the features enabled by +default, as to provide the best end user experience. However some of those +features can easily be toggled on or off. Here is a short list of options to be +passed to the build scripts. + +### Disabling logging + +chip_progress_logging, chip_detail_logging, chip_automation_logging + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + +### Debug build / release build + +is_debug + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false" + +### Disabling LCD + +show_qr_code + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false" diff --git a/examples/lock-app/efr32/README.md b/examples/lock-app/efr32/README.md index 4c82af13cfb24b..65442b31d84229 100644 --- a/examples/lock-app/efr32/README.md +++ b/examples/lock-app/efr32/README.md @@ -297,3 +297,27 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see [EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) + +## Building options + +All of Silabs's examples within the Matter repo have all the features enabled by +default, as to provide the best end user experience. However some of those +features can easily be toggled on or off. Here is a short list of options : + +### Disabling logging + +chip_progress_logging, chip_detail_logging, chip_automation_logging + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + +### Debug build / release build + +is_debug + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false" + +### Disabling LCD + +show_qr_code + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false" diff --git a/examples/window-app/efr32/README.md b/examples/window-app/efr32/README.md index c444d8bae3df0a..8fac6941c0a8d8 100644 --- a/examples/window-app/efr32/README.md +++ b/examples/window-app/efr32/README.md @@ -332,3 +332,27 @@ combination with JLinkRTTClient as follows: For the description of Software Update process with EFR32 example applications see [EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) + +## Building options + +All of Silabs's examples within the Matter repo have all the features enabled by +default, as to provide the best end user experience. However some of those +features can easily be toggled on or off. Here is a short list of options : + +### Disabling logging + +chip_progress_logging, chip_detail_logging, chip_automation_logging + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + +### Debug build / release build + +is_debug + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false" + +### Disabling LCD + +show_qr_code + + $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false" diff --git a/src/platform/EFR32/CHIPMem-Platform.cpp b/src/platform/EFR32/CHIPMem-Platform.cpp index ea7f205a8956b0..4f8b938f5d26ec 100644 --- a/src/platform/EFR32/CHIPMem-Platform.cpp +++ b/src/platform/EFR32/CHIPMem-Platform.cpp @@ -82,25 +82,22 @@ static void VerifyInitialized(const char * func) CHIP_ERROR MemoryAllocatorInit(void * buf, size_t bufSize) { -#ifndef NDEBUG if (memoryInitialized++ > 0) { fprintf(stderr, "ABORT: chip::Platform::MemoryInit() called twice.\n"); abort(); } -#endif + return CHIP_NO_ERROR; } void MemoryAllocatorShutdown() { -#ifndef NDEBUG if (--memoryInitialized < 0) { fprintf(stderr, "ABORT: chip::Platform::MemoryShutdown() called twice.\n"); abort(); } -#endif } void * MemoryAlloc(size_t size)