Skip to content

Commit 5f9982a

Browse files
Add systemView for 917
1 parent 04251f1 commit 5f9982a

File tree

5 files changed

+116
-4
lines changed

5 files changed

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

src/platform/silabs/platformAbstraction/GsdkSpam.cpp

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

8181
#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT
8282
SEGGER_SYSVIEW_Conf();
83-
SEGGER_SYSVIEW_Start();
8483
#endif
8584

8685
#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
@@ -39,6 +39,10 @@ void soc_pll_config(void);
3939
#include "silabs_utils.h"
4040
#endif
4141

42+
#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT
43+
#include "SEGGER_SYSVIEW.h"
44+
#endif
45+
4246
namespace chip {
4347
namespace DeviceLayer {
4448
namespace Silabs {
@@ -63,6 +67,11 @@ CHIP_ERROR SilabsPlatform::Init(void)
6367
#if SILABS_LOG_ENABLED
6468
silabsInitLog();
6569
#endif
70+
71+
#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT
72+
SEGGER_SYSVIEW_Conf();
73+
#endif
74+
6675
return CHIP_NO_ERROR;
6776
}
6877

third_party/silabs/SiWx917_sdk.gni

+28-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ declare_args() {
3030

3131
# Periodic time at which the 917 SoC should wakeup
3232
si91x_alarm_periodic_time = 30
33+
3334
}
3435

3536
# Defines an siwx917 SDK build target.
@@ -43,6 +44,7 @@ template("siwx917_sdk") {
4344
config("${sdk_target_name}_config") {
4445
include_dirs = []
4546
libs = []
47+
defines = []
4648
if (defined(invoker.include_dirs)) {
4749
include_dirs += invoker.include_dirs
4850
}
@@ -143,12 +145,26 @@ template("siwx917_sdk") {
143145
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/inc",
144146
]
145147

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

494+
if (use_system_view) {
495+
sources += [
496+
"${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c",
497+
"${efr32_sdk_root}/util/third_party/segger/systemview/init/SEGGER_SYSVIEW_Init.c",
498+
"${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/SEGGER_SYSVIEW_FreeRTOS.c",
499+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/Global.h",
500+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/SEGGER_RTT_Conf.h",
501+
"${chip_root}/examples/platform/silabs/sl_systemview_config.h",
502+
]
503+
}
504+
478505
if (!disable_lcd) {
479506
sources += [
480507
"${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
@@ -834,6 +836,9 @@ template("efr32_sdk") {
834836
"${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c",
835837
"${efr32_sdk_root}/util/third_party/segger/systemview/init/SEGGER_SYSVIEW_Init.c",
836838
"${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/SEGGER_SYSVIEW_FreeRTOS.c",
839+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/Global.h",
840+
"${efr32_sdk_root}/util/third_party/segger/systemview/Config/SEGGER_RTT_Conf.h",
841+
"${chip_root}/examples/platform/silabs/sl_systemview_config.h",
837842
]
838843
}
839844

0 commit comments

Comments
 (0)