Skip to content

Commit

Permalink
Pull request project-chip#1764: Bugfix/log disabled compilation
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from bugfix/log_disabled_compilation to RC_2.3.0-1.3

Squashed commit of the following:

commit acc94bed0207471cf9308c01d5d65db0a4d307f3
Author: lpbeliveau-silabs <[email protected]>
Date:   Tue Apr 16 09:34:48 2024 -0400

    Added the [[maybe_unused]] attribute to prevent error on variables that are there for logs only

commit c279b1c3b7d6ec0fba2277906e4f25983d0cdf20
Author: lpbeliveau-silabs <[email protected]>
Date:   Thu Apr 11 09:39:39 2024 -0400

    Level Control revert to revision 5 (project-chip#32931)
  • Loading branch information
lpbeliveau-silabs committed Apr 16, 2024
1 parent e1a7cb4 commit 5361dd1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
24 changes: 12 additions & 12 deletions examples/platform/silabs/SoftwareFaultReports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString)
extern "C" __attribute__((used)) void debugHardfault(uint32_t * sp)
{
#if SILABS_LOG_ENABLED
uint32_t cfsr = SCB->CFSR;
uint32_t hfsr = SCB->HFSR;
uint32_t mmfar = SCB->MMFAR;
uint32_t bfar = SCB->BFAR;
uint32_t r0 = sp[0];
uint32_t r1 = sp[1];
uint32_t r2 = sp[2];
uint32_t r3 = sp[3];
uint32_t r12 = sp[4];
uint32_t lr = sp[5];
uint32_t pc = sp[6];
uint32_t psr = sp[7];
[[maybe_unused]] uint32_t cfsr = SCB->CFSR;
[[maybe_unused]] uint32_t hfsr = SCB->HFSR;
[[maybe_unused]] uint32_t mmfar = SCB->MMFAR;
[[maybe_unused]] uint32_t bfar = SCB->BFAR;
[[maybe_unused]] uint32_t r0 = sp[0];
[[maybe_unused]] uint32_t r1 = sp[1];
[[maybe_unused]] uint32_t r2 = sp[2];
[[maybe_unused]] uint32_t r3 = sp[3];
[[maybe_unused]] uint32_t r12 = sp[4];
[[maybe_unused]] uint32_t lr = sp[5];
[[maybe_unused]] uint32_t pc = sp[6];
[[maybe_unused]] uint32_t psr = sp[7];

ChipLogError(NotSpecified, "HardFault:");
ChipLogError(NotSpecified, "SCB->CFSR 0x%08lx", cfsr);
Expand Down
7 changes: 6 additions & 1 deletion third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ template("siwx917_sdk") {
"MBEDTLS_CONFIG_FILE=\"siwx917-chip-mbedtls-config.h\"",
"__STARTUP_CLEAR_BSS",
"HARD_FAULT_LOG_ENABLE",
"SILABS_LOG_ENABLED=${silabs_log_enabled}",
"SL_HEAP_SIZE=32768",
"SL_WIFI=1",
"CCP_SI917_BRINGUP=1",
Expand Down Expand Up @@ -215,6 +214,12 @@ template("siwx917_sdk") {
"NVM3_LOCK_OVERRIDE=1",
]

if(silabs_log_enabled && chip_logging){
defines += [ "SILABS_LOG_ENABLED=1" ]
} else {
defines += [ "SILABS_LOG_ENABLED=0" ]
}

if (chip_build_libshell) {
defines += [ "ENABLE_CHIP_SHELL" ]
}
Expand Down
7 changes: 6 additions & 1 deletion third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ template("efr32_sdk") {
"__STARTUP_CLEAR_BSS",
"HARD_FAULT_LOG_ENABLE",
"CORTEXM3_EFM32_MICRO",
"SILABS_LOG_ENABLED=${silabs_log_enabled}",
"NVM3_DEFAULT_NVM_SIZE=40960",
"NVM3_DEFAULT_MAX_OBJECT_SIZE=4092",
"KVS_MAX_ENTRIES=${kvs_max_entries}",
Expand All @@ -310,6 +309,12 @@ template("efr32_sdk") {
#"__STACK_SIZE=0",
]

if(silabs_log_enabled && chip_logging){
defines += [ "SILABS_LOG_ENABLED=1" ]
} else {
defines += [ "SILABS_LOG_ENABLED=0" ]
}

# Temporary configuration to enable COAP specific configurations
if (use_thread_coap_lib) {
defines += [ "SL_USE_COAP_CONFIG=1" ]
Expand Down

0 comments on commit 5361dd1

Please sign in to comment.