From a3d9d6b839ef70fa578bd63faad146b6b69c42ad Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:50:40 +0100 Subject: [PATCH] Silabs add systemview (#23708) --- examples/platform/efr32/FreeRTOSConfig.h | 4 ++++ examples/platform/efr32/init_efrPlatform.cpp | 8 +++++++ third_party/silabs/efr32_sdk.gni | 22 ++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/examples/platform/efr32/FreeRTOSConfig.h b/examples/platform/efr32/FreeRTOSConfig.h index 35d6e37bf5c813..50f4c24ff31679 100644 --- a/examples/platform/efr32/FreeRTOSConfig.h +++ b/examples/platform/efr32/FreeRTOSConfig.h @@ -117,6 +117,10 @@ extern "C" { #include "sl_component_catalog.h" #endif +#if SL_SYSTEM_VIEW +#include "SEGGER_SYSVIEW_FreeRTOS.h" +#endif + /*----------------------------------------------------------- * Application specific definitions. * diff --git a/examples/platform/efr32/init_efrPlatform.cpp b/examples/platform/efr32/init_efrPlatform.cpp index 36ee0018e8a814..2234be0e6c919a 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -56,12 +56,20 @@ extern "C" { #include "sl_mbedtls.h" #include "sl_system_init.h" +#if SL_SYSTEM_VIEW +#include "SEGGER_SYSVIEW.h" +#endif + void initAntenna(void); void init_efrPlatform(void) { sl_system_init(); sl_mbedtls_init(); +#if SL_SYSTEM_VIEW + SEGGER_SYSVIEW_Conf(); + SEGGER_SYSVIEW_Start(); +#endif #if EFR32_LOG_ENABLED efr32InitLog(); diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index a7b803473f90da..493caaf4de447b 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -35,6 +35,9 @@ declare_args() { # Use Silabs factory data provider example. # Users can implement their own. use_efr32_factory_data_provider = true + + # Enable Segger System View + use_system_view = false } # Explorer Kit and MGM240L do not have external flash @@ -195,6 +198,17 @@ template("efr32_sdk") { #"__STACK_SIZE=0", ] + if (use_system_view) { + _include_dirs += [ + "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10", + "${efr32_sdk_root}/util/third_party/segger/systemview/Config/", + ] + + defines += [ "SL_SYSTEM_VIEW=1" ] + } + defines += board_defines if (use_wstk_leds) { @@ -571,6 +585,14 @@ template("efr32_sdk") { "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_button_instances.c", ] + if (use_system_view) { + sources += [ + "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M/SEGGER_SYSVIEW_Config_FreeRTOS.c", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c", + ] + } + if (use_wstk_leds) { sources += [ "${efr32_sdk_root}/platform/driver/leddrv/src/sl_led.c",