Skip to content

Commit 1b2b85c

Browse files
committed
update sysview to match freeRTOS v10
1 parent d53d59e commit 1b2b85c

14 files changed

+642
-394
lines changed

cores/nRF5/sysview/Config/Global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* *
5353
**********************************************************************
5454
* *
55-
* SystemView version: V2.50 *
55+
* SystemView version: V2.52d *
5656
* *
5757
**********************************************************************
5858
----------------------------------------------------------------------

cores/nRF5/sysview/Config/SEGGER_RTT_Conf.h

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
* *
5353
**********************************************************************
5454
* *
55-
* SystemView version: V2.50 *
55+
* SystemView version: V2.52d *
5656
* *
5757
**********************************************************************
5858
---------------------------END-OF-HEADER------------------------------
5959
File : SEGGER_RTT_Conf.h
6060
Purpose : Implementation of SEGGER real-time transfer (RTT) which
6161
allows real-time communication on targets which support
6262
debugger memory accesses while the CPU is running.
63-
Revision: $Rev: 6249 $
63+
Revision: $Rev: 12706 $
6464
6565
*/
6666

@@ -88,6 +88,28 @@ Revision: $Rev: 6249 $
8888

8989
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP // Mode for pre-initialized terminal channel (buffer 0)
9090

91+
#define USE_RTT_ASM (0) // Use assembler version of SEGGER_RTT.c when 1
92+
93+
/*********************************************************************
94+
*
95+
* RTT memcpy configuration
96+
*
97+
* memcpy() is good for large amounts of data,
98+
* but the overhead is big for small amounts, which are usually stored via RTT.
99+
* With SEGGER_RTT_MEMCPY_USE_BYTELOOP a simple byte loop can be used instead.
100+
*
101+
* SEGGER_RTT_MEMCPY() can be used to replace standard memcpy() in RTT functions.
102+
* This is may be required with memory access restrictions,
103+
* such as on Cortex-A devices with MMU.
104+
*/
105+
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 // 0: Use memcpy/SEGGER_RTT_MEMCPY, 1: Use a simple byte-loop
106+
//
107+
// Example definition of SEGGER_RTT_MEMCPY to external memcpy with GCC toolchains and Cortex-A targets
108+
//
109+
//#if ((defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)) && (defined (__ARM_ARCH_7A__))
110+
// #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) SEGGER_memcpy((pDest), (pSrc), (NumBytes))
111+
//#endif
112+
91113
//
92114
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
93115
// Otherwise we would probably end up with a mixed string in the buffer.
@@ -111,7 +133,7 @@ Revision: $Rev: 6249 $
111133
* Rowley CrossStudio and GCC
112134
*/
113135
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
114-
#ifdef __ARM_ARCH_6M__
136+
#if (defined __ARM_ARCH_6M__) || (defined __ARM_ARCH_8M_BASE__)
115137
#define SEGGER_RTT_LOCK() { \
116138
unsigned int LockState; \
117139
__asm volatile ("mrs %0, primask \n\t" \
@@ -220,6 +242,20 @@ Revision: $Rev: 6249 $
220242
}
221243
#endif
222244

245+
/*********************************************************************
246+
*
247+
* RTT lock configuration for IAR RL78
248+
*/
249+
#ifdef __ICCRL78__
250+
#define SEGGER_RTT_LOCK() { \
251+
__istate_t LockState; \
252+
LockState = __get_interrupt_state(); \
253+
__disable_interrupt();
254+
255+
#define SEGGER_RTT_UNLOCK() __set_interrupt_state(LockState); \
256+
}
257+
#endif
258+
223259
/*********************************************************************
224260
*
225261
* RTT lock configuration for KEIL ARM

cores/nRF5/sysview/Config/SEGGER_SYSVIEW_Conf.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@
5252
* *
5353
**********************************************************************
5454
* *
55-
* SystemView version: V2.50 *
55+
* SystemView version: V2.52d *
5656
* *
5757
**********************************************************************
5858
-------------------------- END-OF-HEADER -----------------------------
5959
6060
File : SEGGER_SYSVIEW_Conf.h
6161
Purpose : SEGGER SystemView configuration.
62-
Revision: $Rev: 6249 $
62+
Revision: $Rev: 12706 $
6363
*/
6464

6565
#ifndef SEGGER_SYSVIEW_CONF_H
@@ -79,8 +79,8 @@ Revision: $Rev: 6249 $
7979
#define SEGGER_SYSVIEW_CORE_CM3 2 // Cortex-M3/M4/M7
8080
#define SEGGER_SYSVIEW_CORE_RX 3 // Renesas RX
8181

82-
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
83-
#ifdef __ARM_ARCH_6M__
82+
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__) || (defined __clang__)
83+
#if (defined __ARM_ARCH_6M__) || (defined __ARM_ARCH_8M_BASE__)
8484
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
8585
#elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
8686
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
@@ -123,7 +123,7 @@ Revision: $Rev: 6249 $
123123
*
124124
* SystemView buffer configuration
125125
*/
126-
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 2*1024 // Number of bytes that SystemView uses for the buffer.
126+
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 1024 // Number of bytes that SystemView uses for the buffer.
127127
#define SEGGER_SYSVIEW_RTT_CHANNEL 1 // The RTT channel that SystemView will use. 0: Auto selection
128128

129129
#define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1 // Use a static buffer to generate events instead of a buffer on the stack
@@ -157,7 +157,11 @@ Revision: $Rev: 6249 $
157157
#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)
158158
#elif SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM0
159159
#if defined(__ICCARM__)
160+
#if (__VER__ > 6100000)
160161
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() (__get_IPSR()) // Workaround for IAR, which might do a byte-access to 0xE000ED04. Read IPSR instead.
162+
#else
163+
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32 *)(0xE000ED04)) & 0x3F) // Older versions of IAR do not include __get_IPSR, but might also not optimize to byte-access.
164+
#endif
161165
#else
162166
#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)
163167
#endif
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*********************************************************************
2+
* (c) 1995 - 2018 SEGGER Microcontroller GmbH *
3+
* The Embedded Experts *
4+
* www.segger.com *
5+
**********************************************************************
6+
7+
-------------------------- END-OF-HEADER -----------------------------
8+
9+
File : SEGGER_SYSVIEW_Config_FreeRTOS.c
10+
Purpose : Sample setup configuration of SystemView with FreeRTOS.
11+
Revision: $Rev: 7745 $
12+
*/
13+
#include "FreeRTOS.h"
14+
#include "SEGGER_SYSVIEW.h"
15+
16+
extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
17+
18+
/*********************************************************************
19+
*
20+
* Defines, configurable
21+
*
22+
**********************************************************************
23+
*/
24+
// The application name to be displayed in SystemViewer
25+
#define SYSVIEW_APP_NAME "Adafruit Bluefruit"
26+
27+
// The target device name
28+
#define SYSVIEW_DEVICE_NAME "nRF52"
29+
30+
// Frequency of the timestamp. Must match SEGGER_SYSVIEW_GET_TIMESTAMP in SEGGER_SYSVIEW_Conf.h
31+
#define SYSVIEW_TIMESTAMP_FREQ (configCPU_CLOCK_HZ)
32+
33+
// System Frequency. SystemcoreClock is used in most CMSIS compatible projects.
34+
#define SYSVIEW_CPU_FREQ configCPU_CLOCK_HZ
35+
36+
// The lowest RAM address used for IDs (pointers)
37+
#define SYSVIEW_RAM_BASE (0x20000000)
38+
39+
/*********************************************************************
40+
*
41+
* _cbSendSystemDesc()
42+
*
43+
* Function description
44+
* Sends SystemView description strings.
45+
*/
46+
static void _cbSendSystemDesc(void) {
47+
SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=FreeRTOS");
48+
SEGGER_SYSVIEW_SendSysDesc("I#15=SysTick");
49+
}
50+
51+
/*********************************************************************
52+
*
53+
* Global functions
54+
*
55+
**********************************************************************
56+
*/
57+
void SEGGER_SYSVIEW_Conf(void) {
58+
SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ,
59+
&SYSVIEW_X_OS_TraceAPI, _cbSendSystemDesc);
60+
SEGGER_SYSVIEW_SetRAMBase(SYSVIEW_RAM_BASE);
61+
}
62+
63+
/*************************** End of file ****************************/

cores/nRF5/sysview/SEGGER/SEGGER.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* *
5353
**********************************************************************
5454
* *
55-
* SystemView version: V2.50 *
55+
* SystemView version: V2.52d *
5656
* *
5757
**********************************************************************
5858
----------------------------------------------------------------------

0 commit comments

Comments
 (0)