Skip to content

Commit cecc2c3

Browse files
[silabs] Add systemView for 917 (project-chip#32701)
* Add systemView for 917 * fix header
1 parent bf45f69 commit cecc2c3

File tree

5 files changed

+122
-4
lines changed

5 files changed

+122
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* @file
3+
* @brief Segger System View configuration file.
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2020 Silicon Laboratories Inc.
7+
*www.silabs.com</b>
8+
*******************************************************************************
9+
*
10+
* SPDX-License-Identifier: Zlib
11+
*
12+
* The licensor of this software is Silicon
13+
*Laboratories Inc.
14+
*
15+
* This software is provided 'as-is', without any
16+
*express or implied warranty. In no event will the
17+
*authors be held liable for any damages arising from
18+
*the use of this software.
19+
*
20+
* Permission is granted to anyone to use this
21+
*software for any purpose, including commercial
22+
*applications, and to alter it and redistribute it
23+
* freely, subject to the following restrictions:
24+
*
25+
* 1. The origin of this software must not be
26+
*misrepresented; you must not claim that you wrote
27+
*the original software. If you use this software in a
28+
*product, an acknowledgment in the product
29+
*documentation would be appreciated but is not
30+
*required.
31+
* 2. Altered source versions must be plainly marked
32+
*as such, and must not be misrepresented as being the
33+
*original software.
34+
* 3. This notice may not be removed or altered from
35+
*any source distribution.
36+
*
37+
******************************************************************************/
38+
39+
// Overwirte SystemView config for GN build, SHOULD NOT BE USED WITH SLC!!!
40+
41+
#pragma once
42+
43+
#define SEGGER_SYSVIEW_TIMESTAMP_SOURCE_DWT 0
44+
#define SEGGER_SYSVIEW_TIMESTAMP_SOURCE_SLEEPTIMER 1
45+
46+
// <o SEGGER_SYSVIEW_TIMESTAMP_SOURCE> Source for the time stamps
47+
// <SEGGER_SYSVIEW_TIMESTAMP_SOURCE_DWT=> DWT Cycle Counter
48+
// <SEGGER_SYSVIEW_TIMESTAMP_SOURCE_SLEEPTIMER=> Sleep Timer
49+
// <i> Source for time stamps. Only meaningful when no OS is present. When an OS is present, time stamp is provided by the OS.
50+
// <i> SEGGER_SYSVIEW_TIMESTAMP_SOURCE_DWT is not available on Cortex-M0+ and cannot be selected.
51+
// <i> Default: SEGGER_SYSVIEW_TIMESTAMP_SOURCE_SLEEPTIMER
52+
#define SEGGER_SYSVIEW_TIMESTAMP_SOURCE SEGGER_SYSVIEW_TIMESTAMP_SOURCE_SLEEPTIMER
53+
54+
// <o SEGGER_SYSVIEW_RTT_BUFFER_SIZE> RTT buffer size (in bytes)
55+
// <i> Default: 1024
56+
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 8192
57+
58+
// <o SEGGER_SYSVIEW_RTT_CHANNEL> RTT channel for SystemView
59+
// <i> Default: 1
60+
#define SEGGER_SYSVIEW_RTT_CHANNEL 1
61+
62+
// <q SEGGER_SYSVIEW_USE_STATIC_BUFFER> Use static buffer to generate events
63+
// <i> Determines if a single static buffer is used to generate the events. If disabled, the buffer is allocated on the stack.
64+
// <i> Default: 1
65+
#define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1
66+
67+
// <q SEGGER_SYSVIEW_POST_MORTEM_MODE> Enable post mortem mode
68+
// <i> Default: 0
69+
#define SEGGER_SYSVIEW_POST_MORTEM_MODE 0
70+
71+
// <q SEGGER_SYSVIEW_CAN_RESTART> Enable SystemView restart
72+
// <i> If enabled, start sequence is sent on every startup. It is not recommended to disabled this feature.
73+
// <i> Default: 1
74+
#define SEGGER_SYSVIEW_CAN_RESTART 1
75+
76+
// <q SEGGER_SYSVIEW_ID_SHIFT> Number of bits to shift the Id to save bandwidth. (i.e. 2 when Ids are 4 byte aligned)
77+
// <i> Default: 0
78+
#define SEGGER_SYSVIEW_ID_SHIFT 0
79+
80+
// <<< end of configuration section >>>

src/platform/silabs/platformAbstraction/GsdkSpam.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ CHIP_ERROR SilabsPlatform::Init(void)
7777

7878
#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT
7979
SEGGER_SYSVIEW_Conf();
80-
SEGGER_SYSVIEW_Start();
8180
#endif
8281

8382
#if SILABS_LOG_OUT_UART || ENABLE_CHIP_SHELL || CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI

src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ void soc_pll_config(void);
3838
#include "silabs_utils.h"
3939
#endif
4040

41+
#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT
42+
#include "SEGGER_SYSVIEW.h"
43+
#endif
44+
4145
namespace chip {
4246
namespace DeviceLayer {
4347
namespace Silabs {
@@ -60,6 +64,11 @@ CHIP_ERROR SilabsPlatform::Init(void)
6064
#if SILABS_LOG_ENABLED
6165
silabsInitLog();
6266
#endif
67+
68+
#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT
69+
SEGGER_SYSVIEW_Conf();
70+
#endif
71+
6372
return CHIP_NO_ERROR;
6473
}
6574

third_party/silabs/SiWx917_sdk.gni

+26-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ template("siwx917_sdk") {
4343
config("${sdk_target_name}_config") {
4444
include_dirs = []
4545
libs = []
46+
defines = []
4647
if (defined(invoker.include_dirs)) {
4748
include_dirs += invoker.include_dirs
4849
}
@@ -143,12 +144,25 @@ template("siwx917_sdk") {
143144
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/inc",
144145
]
145146

147+
if (use_system_view) {
148+
_include_dirs += [
149+
"${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER",
150+
"${efr32_sdk_root}/util/third_party/segger/systemview/init/",
151+
"${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/",
152+
]
153+
154+
defines += [
155+
"SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT",
156+
"SEGGER_SYSVIEW_RTT_BUFFER_SIZE=8192",
157+
]
158+
}
159+
146160
# Note that we're setting the mbedTLS and PSA configuration files through a
147161
# define. This means the build system by default does not pick up changes in
148162
# the content of these, only when changing the filename itself.
149163
# To fix this, these files are also manually depended upon in the source set
150164
# declared in siwx917_mbedtls_config further down this file.
151-
defines = [
165+
defines += [
152166
"MBEDTLS_CONFIG_FILE=\"siwx917-chip-mbedtls-config.h\"",
153167
"__STARTUP_CLEAR_BSS",
154168
"HARD_FAULT_LOG_ENABLE",
@@ -475,6 +489,17 @@ template("siwx917_sdk") {
475489
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/firmware_upgrade/firmware_upgradation.c",
476490
]
477491

492+
if (use_system_view) {
493+
sources += [
494+
"${chip_root}/examples/platform/silabs/sl_systemview_config.h",
495+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/Global.h",
496+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/SEGGER_RTT_Conf.h",
497+
"${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c",
498+
"${efr32_sdk_root}/util/third_party/segger/systemview/init/SEGGER_SYSVIEW_Init.c",
499+
"${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/SEGGER_SYSVIEW_FreeRTOS.c",
500+
]
501+
}
502+
478503
if (!disable_lcd) {
479504
sources += [
480505
"${efr32_sdk_root}/platform/middleware/glib/dmd/display/dmd_memlcd.c",

third_party/silabs/efr32_sdk.gni

+7-2
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,14 @@ template("efr32_sdk") {
403403
if (use_system_view) {
404404
_include_dirs += [
405405
"${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER",
406-
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/",
407406
"${efr32_sdk_root}/util/third_party/segger/systemview/init/",
408407
"${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/",
409408
]
410409

411-
defines += [ "SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT" ]
410+
defines += [
411+
"SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT",
412+
"SEGGER_SYSVIEW_RTT_BUFFER_SIZE=8192",
413+
]
412414
}
413415

414416
defines += board_defines
@@ -831,6 +833,9 @@ template("efr32_sdk") {
831833

832834
if (use_system_view) {
833835
sources += [
836+
"${chip_root}/examples/platform/silabs/sl_systemview_config.h",
837+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/Global.h",
838+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/SEGGER_RTT_Conf.h",
834839
"${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c",
835840
"${efr32_sdk_root}/util/third_party/segger/systemview/init/SEGGER_SYSVIEW_Init.c",
836841
"${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/SEGGER_SYSVIEW_FreeRTOS.c",

0 commit comments

Comments
 (0)