From 0259b9adf092a4b2d1137b411e32ecc96f1bb12b Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 8 May 2024 18:15:00 -0400 Subject: [PATCH] Fix efr32 assert due to missing init, renable RTT logs with pw-rcp enable. Temporaly remove TestExchange from efr32 (#33375) --- src/messaging/tests/BUILD.gn | 4 +++- src/platform/silabs/Logging.cpp | 8 ++++---- src/test_driver/efr32/src/main.cpp | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/messaging/tests/BUILD.gn b/src/messaging/tests/BUILD.gn index 0e56444ba40952..a78dcce953756b 100644 --- a/src/messaging/tests/BUILD.gn +++ b/src/messaging/tests/BUILD.gn @@ -49,13 +49,15 @@ static_library("helpers") { chip_test_suite_using_nltest("tests") { output_name = "libMessagingLayerTests" - test_sources = [ "TestExchange.cpp" ] + test_sources = [] if (chip_device_platform != "efr32") { # TODO(#10447): ReliableMessage Test has HF, and ExchangeMgr hangs on EFR32. # And TestAbortExchangesForFabric does not link on EFR32 for some reason. + # TODO #33372: TestExchange.cpp asserts in ExchangeContext::SendMessage test_sources += [ "TestAbortExchangesForFabric.cpp", + "TestExchange.cpp", "TestExchangeMgr.cpp", "TestReliableMessageProtocol.cpp", ] diff --git a/src/platform/silabs/Logging.cpp b/src/platform/silabs/Logging.cpp index 71f377f94e66e3..3777c96148fb75 100644 --- a/src/platform/silabs/Logging.cpp +++ b/src/platform/silabs/Logging.cpp @@ -136,9 +136,10 @@ static void PrintLog(const char * msg) #if SILABS_LOG_OUT_UART uartLogWrite(msg, sz); -#elif PW_RPC_ENABLED - PigweedLogger::putString(msg, sz); #else +#if PW_RPC_ENABLED + PigweedLogger::putString(msg, sz); +#endif // PW_RPC_ENABLED SEGGER_RTT_WriteNoLock(LOG_RTT_BUFFER_INDEX, msg, sz); #endif // SILABS_LOG_OUT_UART @@ -147,9 +148,8 @@ static void PrintLog(const char * msg) sz = strlen(newline); #if PW_RPC_ENABLED PigweedLogger::putString(newline, sz); -#else - SEGGER_RTT_WriteNoLock(LOG_RTT_BUFFER_INDEX, newline, sz); #endif // PW_RPC_ENABLED + SEGGER_RTT_WriteNoLock(LOG_RTT_BUFFER_INDEX, newline, sz); #endif } } diff --git a/src/test_driver/efr32/src/main.cpp b/src/test_driver/efr32/src/main.cpp index 52015048ee842a..57d0bab32b940b 100644 --- a/src/test_driver/efr32/src/main.cpp +++ b/src/test_driver/efr32/src/main.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -185,6 +186,7 @@ void RunRpcService(void *) int main(void) { + sl_system_init(); chip::DeviceLayer::Silabs::GetPlatform().Init(); PigweedLogger::init(); mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree);