Skip to content

Commit 20b080f

Browse files
committed
Control SysView by CFG_SYSVIEW
Of course, this commit ensures the following: * Zero change to BSP defaults * Zero change to compiled code * Zero change to UI / menu options
1 parent 78cc67e commit 20b080f

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

boards.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ feather52832.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
5959
feather52832.menu.debug.l2=Level 2 (Full Debug)
6060
feather52832.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
6161
feather52832.menu.debug.l3=Level 3 (Segger SystemView)
62-
feather52832.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
62+
feather52832.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
6363

6464
# ----------------------------------
6565
# Bluefruit Feather nRF52840 Express
@@ -112,7 +112,7 @@ feather52840.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
112112
feather52840.menu.debug.l2=Level 2 (Full Debug)
113113
feather52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
114114
feather52840.menu.debug.l3=Level 3 (Segger SystemView)
115-
feather52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
115+
feather52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
116116

117117

118118
# ----------------------------------
@@ -166,7 +166,7 @@ feather52840sense.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
166166
feather52840sense.menu.debug.l2=Level 2 (Full Debug)
167167
feather52840sense.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
168168
feather52840sense.menu.debug.l3=Level 3 (Segger SystemView)
169-
feather52840sense.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
169+
feather52840sense.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
170170

171171

172172
# ---------------------------------------------
@@ -220,7 +220,7 @@ itsybitsy52840.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
220220
itsybitsy52840.menu.debug.l2=Level 2 (Full Debug)
221221
itsybitsy52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
222222
itsybitsy52840.menu.debug.l3=Level 3 (Segger SystemView)
223-
itsybitsy52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
223+
itsybitsy52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
224224

225225
# ---------------------------------------------
226226
# Bluefruit Circuit Playground nRF52840 Express
@@ -273,7 +273,7 @@ cplaynrf52840.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
273273
cplaynrf52840.menu.debug.l2=Level 2 (Full Debug)
274274
cplaynrf52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
275275
cplaynrf52840.menu.debug.l3=Level 3 (Segger SystemView)
276-
cplaynrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
276+
cplaynrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
277277

278278

279279
# ---------------------------------------------
@@ -327,7 +327,7 @@ cluenrf52840.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
327327
cluenrf52840.menu.debug.l2=Level 2 (Full Debug)
328328
cluenrf52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
329329
cluenrf52840.menu.debug.l3=Level 3 (Segger SystemView)
330-
cluenrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
330+
cluenrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
331331

332332
# ----------------------------------
333333
# Bluefruit Metro nRF52840 Express
@@ -380,7 +380,7 @@ metro52840.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
380380
metro52840.menu.debug.l2=Level 2 (Full Debug)
381381
metro52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
382382
metro52840.menu.debug.l3=Level 3 (Segger SystemView)
383-
metro52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
383+
metro52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
384384

385385

386386

@@ -433,7 +433,7 @@ pca10056.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
433433
pca10056.menu.debug.l2=Level 2 (Full Debug)
434434
pca10056.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
435435
pca10056.menu.debug.l3=Level 3 (Segger SystemView)
436-
pca10056.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
436+
pca10056.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
437437

438438
# ----------------------------------
439439
# Particle Xenon
@@ -486,7 +486,7 @@ particle_xenon.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
486486
particle_xenon.menu.debug.l2=Level 2 (Full Debug)
487487
particle_xenon.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
488488
particle_xenon.menu.debug.l3=Level 3 (Segger SystemView)
489-
particle_xenon.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
489+
particle_xenon.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1
490490

491491
# ----------------------------------
492492
# Raytac MDBT50Q - RX
@@ -539,4 +539,4 @@ mdbt50qrx.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
539539
mdbt50qrx.menu.debug.l2=Level 2 (Full Debug)
540540
mdbt50qrx.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
541541
mdbt50qrx.menu.debug.l3=Level 3 (Segger SystemView)
542-
mdbt50qrx.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
542+
mdbt50qrx.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -DCFG_SYSVIEW=1

cores/nRF5/WInterrupts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void detachInterrupt(uint32_t pin)
144144

145145
void GPIOTE_IRQHandler()
146146
{
147-
#if CFG_DEBUG >= 3
147+
#if CFG_SYSVIEW
148148
SEGGER_SYSVIEW_RecordEnterISR();
149149
#endif
150150

@@ -171,7 +171,7 @@ void GPIOTE_IRQHandler()
171171
event = (uint32_t)((uint32_t)event + 4);
172172
}
173173

174-
#if CFG_DEBUG >= 3
174+
#if CFG_SYSVIEW
175175
SEGGER_SYSVIEW_RecordExitISR();
176176
#endif
177177
}

cores/nRF5/freertos/config/FreeRTOSConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ standard names - or at least those used in the unmodified vector table. */
196196
*/
197197
#define configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG 0
198198

199-
// Sysview require at least debug level 3
200-
#if CFG_DEBUG >= 3
199+
// Sysview is enabled by default at debug level 3
200+
#if CFG_SYSVIEW
201201
#include "sysview/SEGGER_SYSVIEW_FreeRTOS.h"
202202
#endif
203203

cores/nRF5/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ void Bluefruit_printInfo() __attribute__((weak));
2424
void Bluefruit_printInfo() {}
2525
#endif
2626

27-
// DEBUG Level 3
28-
#if CFG_DEBUG >= 3
27+
// From the UI, setting debug level to 3 will enable SysView
28+
#if CFG_SYSVIEW
2929
#include "SEGGER_SYSVIEW.h"
3030
#endif
3131

@@ -80,7 +80,7 @@ int main( void )
8080
Adafruit_TinyUSB_Core_init();
8181
#endif
8282

83-
#if CFG_DEBUG >= 3
83+
#if CFG_SYSVIEW
8484
SEGGER_SYSVIEW_Conf();
8585
#endif
8686

cores/nRF5/sysview/SEGGER_SYSVIEW_FreeRTOS.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Purpose : Interface between FreeRTOS and SystemView.
5252
Revision: $Rev: 7947 $
5353
*/
5454

55-
#if CFG_DEBUG >= 3
55+
#if CFG_SYSVIEW
5656

5757
#include "FreeRTOS.h"
5858
#include "task.h"
@@ -252,6 +252,6 @@ const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
252252
_cbSendTaskList,
253253
};
254254

255-
#endif // CFG_DEBUG >= 3
255+
#endif // CFG_SYSVIEW
256256

257257
/*************************** End of file ****************************/

libraries/Wire/Wire_nRF52.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ extern "C"
399399
{
400400
void SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler(void)
401401
{
402-
#if CFG_DEBUG >= 3
402+
#if CFG_SYSVIEW
403403
SEGGER_SYSVIEW_RecordEnterISR();
404404
#endif
405405

406406
Wire.onService();
407407

408-
#if CFG_DEBUG >= 3
408+
#if CFG_SYSVIEW
409409
SEGGER_SYSVIEW_RecordExitISR();
410410
#endif
411411
}
@@ -419,13 +419,13 @@ extern "C"
419419
{
420420
void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler(void)
421421
{
422-
#if CFG_DEBUG >= 3
422+
#if CFG_SYSVIEW
423423
SEGGER_SYSVIEW_RecordEnterISR();
424424
#endif
425425

426426
Wire1.onService();
427427

428-
#if CFG_DEBUG >= 3
428+
#if CFG_SYSVIEW
429429
SEGGER_SYSVIEW_RecordExitISR();
430430
#endif
431431
}

0 commit comments

Comments
 (0)