Skip to content

Commit

Permalink
[SL-UP] Bugfix/silabs out rtt removal (project-chip#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs authored Nov 28, 2024
1 parent c352461 commit e4c96d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
13 changes: 4 additions & 9 deletions src/platform/silabs/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@
#include "uart.h"
#endif

// Enable RTT by default
#ifndef SILABS_LOG_OUT_RTT
#define SILABS_LOG_OUT_RTT 1
#endif

// SEGGER_RTT includes
#if SILABS_LOG_OUT_RTT
#if !SILABS_LOG_OUT_UART
#include "SEGGER_RTT.h"
#include "SEGGER_RTT_Conf.h"
#endif
Expand Down Expand Up @@ -137,7 +132,7 @@ static void PrintLog(const char * msg)
SEGGER_RTT_WriteNoLock(LOG_RTT_BUFFER_INDEX, msg, sz);
#endif // SILABS_LOG_OUT_UART

#if SILABS_LOG_OUT_RTT || PW_RPC_ENABLED
#if !SILABS_LOG_OUT_UART || PW_RPC_ENABLED
const char * newline = "\r\n";
sz = strlen(newline);
#if PW_RPC_ENABLED
Expand All @@ -155,7 +150,7 @@ static void PrintLog(const char * msg)
extern "C" void silabsInitLog(void)
{
#if SILABS_LOG_ENABLED
#if SILABS_LOG_OUT_RTT
#if !SILABS_LOG_OUT_UART
#if LOG_RTT_BUFFER_INDEX != 0
SEGGER_RTT_ConfigUpBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sLogBuffer, LOG_RTT_BUFFER_SIZE,
SEGGER_RTT_MODE_NO_BLOCK_TRIM);
Expand All @@ -165,7 +160,7 @@ extern "C" void silabsInitLog(void)
#else
SEGGER_RTT_SetFlagsUpBuffer(LOG_RTT_BUFFER_INDEX, SEGGER_RTT_MODE_NO_BLOCK_TRIM);
#endif
#endif // SILABS_LOG_OUT_RTT
#endif // !SILABS_LOG_OUT_UART

#ifdef PW_RPC_ENABLED
PigweedLogger::init();
Expand Down
8 changes: 1 addition & 7 deletions third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ template("siwx917_sdk") {
"UDMA_ROMDRIVER_PRESENT=1",
"PLL_ROMDRIVER_PRESENT=1",
"SL_MATTER_GN_BUILD=1",
"SILABS_LOG_OUT_UART=${sl_uart_log_output}",
]

if (silabs_log_enabled && chip_logging) {
Expand Down Expand Up @@ -333,13 +334,6 @@ template("siwx917_sdk") {
]
}

if (sl_uart_log_output) {
defines += [
"SILABS_LOG_OUT_UART=1",
"SILABS_LOG_OUT_RTT=0",
]
}

if (chip_build_libshell) { # matter shell
defines += [ "ENABLE_CHIP_SHELL" ]
}
Expand Down
8 changes: 1 addition & 7 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ template("efr32_sdk") {
"SL_OPENTHREAD_STACK_FEATURES_CONFIG_FILE=\"sl_openthread_features_config.h\"",
"SL_CSL_TIMEOUT=${sl_ot_csl_timeout_sec}",
"CIRCULAR_QUEUE_USE_LOCAL_CONFIG_HEADER=1",
"SILABS_LOG_OUT_UART=${sl_uart_log_output}",
]

if (silabs_log_enabled && chip_logging) {
Expand All @@ -489,13 +490,6 @@ template("efr32_sdk") {
defines += [ "SILABS_LOG_ENABLED=0" ]
}

if (sl_uart_log_output) {
defines += [
"SILABS_LOG_OUT_UART=1",
"SILABS_LOG_OUT_RTT=0",
]
}

if (use_silabs_thread_lib) {
defines += [ "SL_CONFIG_OPENTHREAD_LIB=1" ]
} else {
Expand Down

0 comments on commit e4c96d0

Please sign in to comment.