Skip to content

Commit 0019306

Browse files
authored
Merge pull request #469 from henrygab/enable_sysview
[WIP] Enable/Disable SysView via CFG_SYSVIEW
2 parents 78cc67e + a9e109d commit 0019306

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

boards.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ 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)
6262
feather52832.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
63+
feather52832.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
6364

6465
# ----------------------------------
6566
# Bluefruit Feather nRF52840 Express
@@ -113,6 +114,7 @@ feather52840.menu.debug.l2=Level 2 (Full Debug)
113114
feather52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
114115
feather52840.menu.debug.l3=Level 3 (Segger SystemView)
115116
feather52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
117+
feather52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
116118

117119

118120
# ----------------------------------
@@ -167,6 +169,7 @@ feather52840sense.menu.debug.l2=Level 2 (Full Debug)
167169
feather52840sense.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
168170
feather52840sense.menu.debug.l3=Level 3 (Segger SystemView)
169171
feather52840sense.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
172+
feather52840sense.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
170173

171174

172175
# ---------------------------------------------
@@ -221,6 +224,7 @@ itsybitsy52840.menu.debug.l2=Level 2 (Full Debug)
221224
itsybitsy52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
222225
itsybitsy52840.menu.debug.l3=Level 3 (Segger SystemView)
223226
itsybitsy52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
227+
itsybitsy52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
224228

225229
# ---------------------------------------------
226230
# Bluefruit Circuit Playground nRF52840 Express
@@ -274,6 +278,7 @@ cplaynrf52840.menu.debug.l2=Level 2 (Full Debug)
274278
cplaynrf52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
275279
cplaynrf52840.menu.debug.l3=Level 3 (Segger SystemView)
276280
cplaynrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
281+
cplaynrf52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
277282

278283

279284
# ---------------------------------------------
@@ -328,6 +333,7 @@ cluenrf52840.menu.debug.l2=Level 2 (Full Debug)
328333
cluenrf52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
329334
cluenrf52840.menu.debug.l3=Level 3 (Segger SystemView)
330335
cluenrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
336+
cluenrf52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
331337

332338
# ----------------------------------
333339
# Bluefruit Metro nRF52840 Express
@@ -381,6 +387,7 @@ metro52840.menu.debug.l2=Level 2 (Full Debug)
381387
metro52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
382388
metro52840.menu.debug.l3=Level 3 (Segger SystemView)
383389
metro52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
390+
metro52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
384391

385392

386393

@@ -434,6 +441,7 @@ pca10056.menu.debug.l2=Level 2 (Full Debug)
434441
pca10056.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
435442
pca10056.menu.debug.l3=Level 3 (Segger SystemView)
436443
pca10056.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
444+
pca10056.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
437445

438446
# ----------------------------------
439447
# Particle Xenon
@@ -487,6 +495,7 @@ particle_xenon.menu.debug.l2=Level 2 (Full Debug)
487495
particle_xenon.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
488496
particle_xenon.menu.debug.l3=Level 3 (Segger SystemView)
489497
particle_xenon.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
498+
particle_xenon.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
490499

491500
# ----------------------------------
492501
# Raytac MDBT50Q - RX
@@ -540,3 +549,4 @@ mdbt50qrx.menu.debug.l2=Level 2 (Full Debug)
540549
mdbt50qrx.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
541550
mdbt50qrx.menu.debug.l3=Level 3 (Segger SystemView)
542551
mdbt50qrx.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
552+
mdbt50qrx.menu.debug.l3.build.sysview_flags=-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)