SmartSnippets DA1459x SDK
SEGGER_SYSVIEW_Conf.h
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH *
3 * The Embedded Experts *
4 **********************************************************************
5 * *
6 * (c) 1995 - 2021 SEGGER Microcontroller GmbH *
7 * *
8 * www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 * *
12 * SEGGER SystemView * Real-time application analysis *
13 * *
14 **********************************************************************
15 * *
16 * All rights reserved. *
17 * *
18 * SEGGER strongly recommends to not make any changes *
19 * to or modify the source code of this software in order to stay *
20 * compatible with the SystemView and RTT protocol, and J-Link. *
21 * *
22 * Redistribution and use in source and binary forms, with or *
23 * without modification, are permitted provided that the following *
24 * condition is met: *
25 * *
26 * o Redistributions of source code must retain the above copyright *
27 * notice, this condition and the following disclaimer. *
28 * *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
30 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
31 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
32 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
33 * DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
34 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
36 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
37 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
38 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
40 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
41 * DAMAGE. *
42 * *
43 **********************************************************************
44 * *
45 * SystemView version: 3.30 *
46 * *
47 **********************************************************************
48 -------------------------- END-OF-HEADER -----------------------------
49 
50 File : SEGGER_SYSVIEW_Conf.h
51 Purpose : SEGGER SystemView configuration file.
52  Set defines which deviate from the defaults (see SEGGER_SYSVIEW_ConfDefaults.h) here.
53 Revision: $Rev: 21292 $
54 
55 Additional information:
56  Required defines which must be set are:
57  SEGGER_SYSVIEW_GET_TIMESTAMP
58  SEGGER_SYSVIEW_GET_INTERRUPT_ID
59  For known compilers and cores, these might be set to good defaults
60  in SEGGER_SYSVIEW_ConfDefaults.h.
61 
62  SystemView needs a (nestable) locking mechanism.
63  If not defined, the RTT locking mechanism is used,
64  which then needs to be properly configured.
65 */
66 
67 #ifndef SEGGER_SYSVIEW_CONF_H
68 #define SEGGER_SYSVIEW_CONF_H
69 
70 #if dg_configSYSTEMVIEW
71 
72 /*********************************************************************
73 *
74 * Defines, fixed
75 *
76 **********************************************************************
77 */
78 //
79 // Constants for known core configuration
80 //
81 #define SEGGER_SYSVIEW_CORE_OTHER 0
82 #define SEGGER_SYSVIEW_CORE_CM0 1 // Cortex-M0/M0+/M1
83 #define SEGGER_SYSVIEW_CORE_CM3 2 // Cortex-M3/M4/M7
84 #define SEGGER_SYSVIEW_CORE_RX 3 // Renesas RX
85 
86 #if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
87  #ifdef __ARM_ARCH_6M__
88  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
89  #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
90  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
91  #endif
92 #elif defined(__ICCARM__)
93  #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__))
94  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
95  #elif ((defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)))
96  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
97  #endif
98 #elif defined(__CC_ARM)
99  #if (defined(__TARGET_ARCH_6S_M))
100  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
101  #elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
102  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
103  #endif
104 #elif defined(__TI_ARM__)
105  #ifdef __TI_ARM_V6M0__
106  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
107  #elif (defined(__TI_ARM_V7M3__) || defined(__TI_ARM_V7M4__))
108  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
109  #endif
110 #elif defined(__ICCRX__)
111  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
112 #elif defined(__RX)
113  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
114 #endif
115 
116 #ifndef SEGGER_SYSVIEW_CORE
117  #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_OTHER
118 #endif
119 
120 /*********************************************************************
121 *
122 * Defines, configurable
123 *
124 **********************************************************************
125 */
126 /*********************************************************************
127 *
128 * SystemView buffer configuration
129 */
130 #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 1024 // Number of bytes that SystemView uses for the buffer.
131 #define SEGGER_SYSVIEW_RTT_CHANNEL 1 // The RTT channel that SystemView will use. 0: Auto selection
132 
133 #define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1 // Use a static buffer to generate events instead of a buffer on the stack
134 
135 #define SEGGER_SYSVIEW_POST_MORTEM_MODE 0 // 1: Enable post mortem analysis mode
136 
137 /*********************************************************************
138 *
139 * SystemView timestamp configuration
140 */
141 #if SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3
142  #define SEGGER_SYSVIEW_GET_TIMESTAMP() (*(U32 *)(0xE0001004)) // Retrieve a system timestamp. Cortex-M cycle counter.
143  #define SEGGER_SYSVIEW_TIMESTAMP_BITS 32 // Define number of valid bits low-order delivered by clock source
144 #else
145  #define SEGGER_SYSVIEW_GET_TIMESTAMP() SEGGER_SYSVIEW_X_GetTimestamp() // Retrieve a system timestamp via user-defined function
146  #define SEGGER_SYSVIEW_TIMESTAMP_BITS 32 // Define number of valid bits low-order delivered by SEGGER_SYSVIEW_X_GetTimestamp()
147 #endif
148 
149 /*********************************************************************
150 *
151 * SystemView Id configuration
152 */
153 #define SEGGER_SYSVIEW_ID_BASE 0x10000000 // Default value for the lowest Id reported by the application. Can be overridden by the application via SEGGER_SYSVIEW_SetRAMBase(). (i.e. 0x20000000 when all Ids are an address in this RAM)
154 #define SEGGER_SYSVIEW_ID_SHIFT 2 // Number of bits to shift the Id to save bandwidth. (i.e. 2 when Ids are 4 byte aligned)
155 
156 /*********************************************************************
157 *
158 * SystemView interrupt configuration
159 */
160 #if SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3
161  #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32 *)(0xE000ED04)) & 0x1FF) // Get the currently active interrupt Id. (i.e. read Cortex-M ICSR[8:0] = active vector)
162 #elif SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM0
163  #if defined(__ICCARM__)
164  #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() (__get_IPSR()) // Workaround for IAR, which might do a byte-access to 0xE000ED04. Read IPSR instead.
165  #else
166  #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32 *)(0xE000ED04)) & 0x3F) // Get the currently active interrupt Id. (i.e. read Cortex-M ICSR[5:0] = active vector)
167  #endif
168 #else
169  #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() SEGGER_SYSVIEW_X_GetInterruptId() // Get the currently active interrupt Id from the user-provided function.
170 #endif
171 
172 #endif /* dg_configSYSTEMVIEW */
173 
174 #endif // SEGGER_SYSVIEW_CONF_H
175 
176 /*************************** End of file ****************************/