Skip to content

Commit 55a922b

Browse files
committed
close #30 add sysview realtrace support
1 parent efd8c48 commit 55a922b

20 files changed

+6692
-5
lines changed

boards.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ feather52.menu.debug.l1=Level 1 (Error Message)
5353
feather52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
5454
feather52.menu.debug.l2=Level 2 (Full Debug)
5555
feather52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
56+
feather52.menu.debug.l3=Level 3 (Realtime Trace, Jlink required)
57+
feather52.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -Os
5658

5759
#**********************************************
5860
# Metro nrf52 Board
@@ -83,3 +85,5 @@ feather52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
8385
#metro52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
8486
#metro52.menu.debug.l2=Level 2 (Full Debug)
8587
#metro52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
88+
#metro52.menu.debug.l3=Level 3 (Realtime Trace, Jlink required)
89+
#metro52.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -Og

cores/nRF5/freertos/config/FreeRTOSConfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,4 +239,9 @@ standard names - or at least those used in the unmodified vector table. */
239239
*/
240240
#define configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG 0
241241

242+
// Sysview require at least debug level 3
243+
#if CFG_DEBUG >= 3
244+
#include "sysview/SEGGER_SYSVIEW_FreeRTOS.h"
245+
#endif
246+
242247
#endif /* FREERTOS_CONFIG_H */

cores/nRF5/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#define ARDUINO_MAIN
1717
#include "Arduino.h"
1818

19+
#if CFG_DEBUG >= 3
20+
#include "SEGGER_SYSVIEW.h"
21+
#endif
22+
1923
#define MEMINFO_INTERVAL 60000
2024

2125
// Weak empty variant initialization function.
@@ -71,6 +75,10 @@ int main( void )
7175
_loopStacksize = setLoopStacksize();
7276
}
7377

78+
#if CFG_DEBUG >= 3
79+
SEGGER_SYSVIEW_Conf();
80+
#endif
81+
7482
// Create a task for loop()
7583
TaskHandle_t _loopHandle;
7684
xTaskCreate( loop_task, "loop", _loopStacksize, NULL, TASK_PRIO_NORMAL, &_loopHandle);

cores/nRF5/rtos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,6 @@ class SchedulerRTOS
107107
extern SchedulerRTOS Scheduler;
108108

109109
#endif
110+
111+
110112
#endif /* RTOS_H_ */

cores/nRF5/sysview/Config/Global.h

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*********************************************************************
2+
* SEGGER Microcontroller GmbH & Co. KG *
3+
* The Embedded Experts *
4+
**********************************************************************
5+
* *
6+
* (c) 2015 - 2017 SEGGER Microcontroller GmbH & Co. KG *
7+
* *
8+
* www.segger.com Support: [email protected] *
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 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+
* conditions are met: *
25+
* *
26+
* o Redistributions of source code must retain the above copyright *
27+
* notice, this list of conditions and the following disclaimer. *
28+
* *
29+
* o Redistributions in binary form must reproduce the above *
30+
* copyright notice, this list of conditions and the following *
31+
* disclaimer in the documentation and/or other materials provided *
32+
* with the distribution. *
33+
* *
34+
* o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
35+
* nor the names of its contributors may be used to endorse or *
36+
* promote products derived from this software without specific *
37+
* prior written permission. *
38+
* *
39+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
40+
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
41+
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
42+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
43+
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
44+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
45+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
46+
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
47+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
48+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
49+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
50+
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
51+
* DAMAGE. *
52+
* *
53+
**********************************************************************
54+
* *
55+
* SystemView version: V2.50 *
56+
* *
57+
**********************************************************************
58+
----------------------------------------------------------------------
59+
File : Global.h
60+
Purpose : Global types
61+
In case your application already has a Global.h, you should
62+
merge the files. In order to use Segger code, the types
63+
U8, U16, U32, I8, I16, I32 need to be defined in Global.h;
64+
additional definitions do not hurt.
65+
---------------------------END-OF-HEADER------------------------------
66+
*/
67+
68+
#ifndef GLOBAL_H // Guard against multiple inclusion
69+
#define GLOBAL_H
70+
71+
#define U8 unsigned char
72+
#define U16 unsigned short
73+
#define U32 unsigned long
74+
#define I8 signed char
75+
#define I16 signed short
76+
#define I32 signed long
77+
78+
#ifdef _WIN32
79+
//
80+
// Microsoft VC6 compiler related
81+
//
82+
#define U64 unsigned __int64
83+
#define U128 unsigned __int128
84+
#define I64 __int64
85+
#define I128 __int128
86+
#if _MSC_VER <= 1200
87+
#define U64_C(x) x##UI64
88+
#else
89+
#define U64_C(x) x##ULL
90+
#endif
91+
#else
92+
//
93+
// C99 compliant compiler
94+
//
95+
#define U64 unsigned long long
96+
#define I64 signed long long
97+
#define U64_C(x) x##ULL
98+
#endif
99+
100+
#endif // Avoid multiple inclusion
101+
102+
/*************************** End of file ****************************/

0 commit comments

Comments
 (0)