SystemView lets you see your RTOS: who ran, when, how long, and why. You’ll install the host app, drop target sources into your project, enable timestamping, and then record—either real-time (via RTT/J-Link) or single-shot (dump a RAM buffer).
✅ Minimal wiring (headers + start)
⏱ Enable precise timestamps (Cortex-M3/M4/M7)
Call dwt_time_start() early in main() before starting the scheduler.
⚙️ FreeRTOS config touch-ups
(If you don’t use software timers, you can set configUSE_TIMERS to 0 to skip the timer task.)
๐ Real-time vs. ๐ผ Single-shot
-
Real-time (continuous): J-Link + RTT streams events to the PC as they happen.
-
Single-shot: Fill the RTT buffer in RAM, pause, dump it to a
.SVDatfile, then File → Load Data in SystemView.
Tip (single-shot): In your IDE, locate the RTT control symbol (e.g., _SEGGER_RTT), open Memory Browser at its address, and Export RAW for the configured buffer size (e.g., 4096 bytes).
๐ฃ Sending messages to the timeline (cleanly)
๐งน Avoid garbled prints under pre-emption
Shared sinks (ITM/UART) need a mutex or switch to co-operative segments using taskYIELD() after complete messages.
⚡ Pro Tips
-
Increase
SEGGER_SYSVIEW_RTT_BUFFER_SIZE(e.g., 4096) if you drop events. -
Define the right core in SystemView config (e.g., Cortex-M3/M4/M7).
-
Keep include paths for
SEGGER/Config,SEGGER/OS, andSEGGERtarget folders. -
In Cube projects, put changes inside USER CODE BEGIN/END blocks.
๐ฏ Conclusion
Wire up SystemView once, and you’ll never guess again—timestamps, context switches, ISR time, CPU load are all on one timeline.
Written By: Musaab Taha
This article was improved with the assistance of AI.
No comments:
Post a Comment