Hello,
I have the "strong" feeling, that the lock/unlock code in SEGGER_RTT_Conf.h is not correct. At least with nRF52840 without OS, but I think this actually doesn't matter.
I'm currently playing around with SystemView and with just a main "thread" (i.e. without interrupts) the SystemView data stream is ok. Events arrive correctly at SystemView and are displayed accordingly.
But if there is an additional SystemTick interrupt (123/s), then SystemView eventually shows messed up data like "ISR 17" or "ISR 8738" (at the moment of writing I have 10000 regular SysTicks and 5 wrong ISRs). Randomly data recording is aborted or SystemView even crahses.
Changing the lock/unlock code to:
Display All
...the problem disappears (150000 SysTicks and counting).
Now I'm wondering (because I'm by no means a Cortex-Mx assembler guru) if I'm completely mistaken or if there is really something broken.
An example project can be found here: github.com/rgrr/playground/tre…ure/xray/tools/SystemView (see last section of README for some images).
Data is pulled out of the device via RTT with my own probe: github.com/rgrr/yapicoprobe/tree/feature/systemview-rndis
Both repos are work-in-progress.
Regards
Hardy
I have the "strong" feeling, that the lock/unlock code in SEGGER_RTT_Conf.h is not correct. At least with nRF52840 without OS, but I think this actually doesn't matter.
I'm currently playing around with SystemView and with just a main "thread" (i.e. without interrupts) the SystemView data stream is ok. Events arrive correctly at SystemView and are displayed accordingly.
But if there is an additional SystemTick interrupt (123/s), then SystemView eventually shows messed up data like "ISR 17" or "ISR 8738" (at the moment of writing I have 10000 regular SysTicks and 5 wrong ISRs). Randomly data recording is aborted or SystemView even crahses.
Changing the lock/unlock code to:
C Source Code
- #ifndef SEGGER_RTT_ASM
- __attribute__((always_inline)) static inline void __enable_irqXX(void)
- {
- __asm volatile ("cpsie i" : : : "memory");
- }
- __attribute__((always_inline)) static inline void __disable_irqXX(void)
- {
- __asm volatile ("cpsid i" : : : "memory");
- }
- __attribute__((always_inline)) static inline unsigned __get_PRIMASKXX(void)
- {
- unsigned result;
- __asm volatile ("MRS %0, primask" : "=r" (result) );
- return(result);
- }
- #define SEGGER_RTT_LOCK() unsigned __prim = __get_PRIMASKXX(); __disable_irqXX();
- #define SEGGER_RTT_UNLOCK() if (!__prim) { __enable_irqXX(); }
- #endif
Now I'm wondering (because I'm by no means a Cortex-Mx assembler guru) if I'm completely mistaken or if there is really something broken.
An example project can be found here: github.com/rgrr/playground/tre…ure/xray/tools/SystemView (see last section of README for some images).
Data is pulled out of the device via RTT with my own probe: github.com/rgrr/yapicoprobe/tree/feature/systemview-rndis
Both repos are work-in-progress.
Regards
Hardy
The post was edited 1 time, last by rgrr: - made the code more eye friendly - note about README ().