andrzej-kaczmarek closed pull request #1342: Minor SystemView updates
URL: https://github.com/apache/mynewt-core/pull/1342
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/mcu/nordic/nrf52xxx-compat/include/mcu/mcu.h 
b/hw/mcu/nordic/nrf52xxx-compat/include/mcu/mcu.h
index 5b9abf411f..1950c85fde 100644
--- a/hw/mcu/nordic/nrf52xxx-compat/include/mcu/mcu.h
+++ b/hw/mcu/nordic/nrf52xxx-compat/include/mcu/mcu.h
@@ -38,26 +38,26 @@ extern "C" {
 #define MCU_SYSVIEW_INTERRUPTS \
     
"I#1=Reset,I#2=MNI,I#3=HardFault,I#4=MemoryMgmt,I#5=BusFault,I#6=UsageFault," \
     "I#11=SVCall,I#12=DebugMonitor,I#14=PendSV,I#15=SysTick," \
-    
"I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0,"
 \
-    "I#20=SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," 
\
+    "I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIx0_TWIx0," \
+    "I#20=SPIx1_TWIx1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," \
     
"I#24=TIMER0,I#25=TIMER1,I#26=TIMER2,I#27=RTC0,I#28=TEMP,I#29=RNG,I#30=ECB," \
     
"I#31=CCM_AAR,I#32=WDT,I#33=RTC1,I#34=QDEC,I#35=COMP_LPCOMP,I#36=SWI0_EGU0," \
     
"I#37=SWI1_EGU1,I#38=SWI2_EGU2,I#39=SWI3_EGU3,I#40=SWI4_EGU4,I#41=SWI5_EGU5," \
     "I#42=TIMER3,I#43=TIMER4,I#44=PWM0,I#45=PDM,I#48=MWU,I#49=PWM1,I#50=PWM2," 
\
-    "I#51=SPIM2_SPIS2_SPI2,I#52=RTC2,I#53=I2S,I#54=FPU"
+    "I#51=SPIx2,I#52=RTC2,I#53=I2S,I#54=FPU"
 
 #elif NRF52840_XXAA
 
 #define MCU_SYSVIEW_INTERRUPTS \
     
"I#1=Reset,I#2=MNI,I#3=HardFault,I#4=MemoryMgmt,I#5=BusFault,I#6=UsageFault," \
     "I#11=SVCall,I#12=DebugMonitor,I#14=PendSV,I#15=SysTick," \
-    
"I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0,"
 \
-    "I#20=SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," 
\
+    "I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIx0_TWIx0," \
+    "I#20=SPIx1_TWIx1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," \
     
"I#24=TIMER0,I#25=TIMER1,I#26=TIMER2,I#27=RTC0,I#28=TEMP,I#29=RNG,I#30=ECB," \
     
"I#31=CCM_AAR,I#32=WDT,I#33=RTC1,I#34=QDEC,I#35=COMP_LPCOMP,I#36=SWI0_EGU0," \
     
"I#37=SWI1_EGU1,I#38=SWI2_EGU2,I#39=SWI3_EGU3,I#40=SWI4_EGU4,I#41=SWI5_EGU5," \
     "I#42=TIMER3,I#43=TIMER4,I#44=PWM0,I#45=PDM,I#48=MWU,I#49=PWM1,I#50=PWM2," 
\
-    "I#51=SPIM2_SPIS2_SPI2,I#52=RTC2,I#53=I2S,I#54=FPU,I#55=USBD," \
+    "I#51=SPIx2,I#52=RTC2,I#53=I2S,I#54=FPU,I#55=USBD," \
     "I#56=UARTE1,I#57=QSPI,I#58=CRYPTOCELL,I#61=PWM3,I#63=SPIM3"
 
 #endif
diff --git a/hw/mcu/nordic/nrf52xxx/include/mcu/mcu.h 
b/hw/mcu/nordic/nrf52xxx/include/mcu/mcu.h
index 5b9abf411f..1950c85fde 100644
--- a/hw/mcu/nordic/nrf52xxx/include/mcu/mcu.h
+++ b/hw/mcu/nordic/nrf52xxx/include/mcu/mcu.h
@@ -38,26 +38,26 @@ extern "C" {
 #define MCU_SYSVIEW_INTERRUPTS \
     
"I#1=Reset,I#2=MNI,I#3=HardFault,I#4=MemoryMgmt,I#5=BusFault,I#6=UsageFault," \
     "I#11=SVCall,I#12=DebugMonitor,I#14=PendSV,I#15=SysTick," \
-    
"I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0,"
 \
-    "I#20=SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," 
\
+    "I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIx0_TWIx0," \
+    "I#20=SPIx1_TWIx1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," \
     
"I#24=TIMER0,I#25=TIMER1,I#26=TIMER2,I#27=RTC0,I#28=TEMP,I#29=RNG,I#30=ECB," \
     
"I#31=CCM_AAR,I#32=WDT,I#33=RTC1,I#34=QDEC,I#35=COMP_LPCOMP,I#36=SWI0_EGU0," \
     
"I#37=SWI1_EGU1,I#38=SWI2_EGU2,I#39=SWI3_EGU3,I#40=SWI4_EGU4,I#41=SWI5_EGU5," \
     "I#42=TIMER3,I#43=TIMER4,I#44=PWM0,I#45=PDM,I#48=MWU,I#49=PWM1,I#50=PWM2," 
\
-    "I#51=SPIM2_SPIS2_SPI2,I#52=RTC2,I#53=I2S,I#54=FPU"
+    "I#51=SPIx2,I#52=RTC2,I#53=I2S,I#54=FPU"
 
 #elif NRF52840_XXAA
 
 #define MCU_SYSVIEW_INTERRUPTS \
     
"I#1=Reset,I#2=MNI,I#3=HardFault,I#4=MemoryMgmt,I#5=BusFault,I#6=UsageFault," \
     "I#11=SVCall,I#12=DebugMonitor,I#14=PendSV,I#15=SysTick," \
-    
"I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0,"
 \
-    "I#20=SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," 
\
+    "I#16=POWER_CLOCK,I#17=RADIO,I#18=UARTE0_UART0,I#19=SPIx0_TWIx0," \
+    "I#20=SPIx1_TWIx1,I#21=NFCT,I#22=GPIOTE,I#23=SAADC," \
     
"I#24=TIMER0,I#25=TIMER1,I#26=TIMER2,I#27=RTC0,I#28=TEMP,I#29=RNG,I#30=ECB," \
     
"I#31=CCM_AAR,I#32=WDT,I#33=RTC1,I#34=QDEC,I#35=COMP_LPCOMP,I#36=SWI0_EGU0," \
     
"I#37=SWI1_EGU1,I#38=SWI2_EGU2,I#39=SWI3_EGU3,I#40=SWI4_EGU4,I#41=SWI5_EGU5," \
     "I#42=TIMER3,I#43=TIMER4,I#44=PWM0,I#45=PDM,I#48=MWU,I#49=PWM1,I#50=PWM2," 
\
-    "I#51=SPIM2_SPIS2_SPI2,I#52=RTC2,I#53=I2S,I#54=FPU,I#55=USBD," \
+    "I#51=SPIx2,I#52=RTC2,I#53=I2S,I#54=FPU,I#55=USBD," \
     "I#56=UARTE1,I#57=QSPI,I#58=CRYPTOCELL,I#61=PWM3,I#63=SPIM3"
 
 #endif
diff --git a/sys/sysview/src/sysview_mynewt.c b/sys/sysview/src/sysview_mynewt.c
index 0e2d9930a8..51f1687aa9 100644
--- a/sys/sysview/src/sysview_mynewt.c
+++ b/sys/sysview/src/sysview_mynewt.c
@@ -140,5 +140,8 @@ sysview_init(void)
     SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ,
                         &sysview_os_api, sysview_os_api_send_sys_desc_func);
     SEGGER_SYSVIEW_SetRAMBase(SYSVIEW_RAM_BASE);
+
+#if MYNEWT_VAL(SYSVIEW_POST_MORTEM)
     SEGGER_SYSVIEW_Start();
+#endif
 }
diff --git a/sys/sysview/syscfg.yml b/sys/sysview/syscfg.yml
index f7412a2882..ef3d06243b 100644
--- a/sys/sysview/syscfg.yml
+++ b/sys/sysview/syscfg.yml
@@ -36,3 +36,11 @@ syscfg.defs:
         description: >
             Timestamp timer frequency.
         value: 1000000
+    SYSVIEW_POST_MORTEM:
+        description: >
+            Enable post-mortem mode.
+            Traces are continuously stored in cyclic buffer which can be read
+            from the target e.g. after unattended system crashed unexpectedly.
+            It is recommended to use large SysView buffer to get as much data
+            for analysis as possible.
+        value: 0
diff --git a/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h 
b/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h
index cd85a2f3dc..edc28274fc 100644
--- a/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h
+++ b/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h
@@ -130,7 +130,11 @@ Revision: $Rev: 5626 $
 
 #define SEGGER_SYSVIEW_USE_STATIC_BUFFER    1                                  
 // Use a static buffer to generate events instead of a buffer on the stack
 
+#if MYNEWT_VAL(SYSVIEW_POST_MORTEM)
+#define SEGGER_SYSVIEW_POST_MORTEM_MODE     1
+#else
 #define SEGGER_SYSVIEW_POST_MORTEM_MODE     0                                  
 // 1: Enable post mortem analysis mode
+#endif
 
 /*********************************************************************
 *


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to