Single-shot recording
Single-shot recording offers insight to the startup sequence or event-triggered activity in any system for a decent amount of time.
Overview
When the target device does not support RTT or when no J-Link is used, SystemView can still record data into its buffer until it is filled. In single-shot mode the recording is started manually in the application. This enables recording only specific parts, which are of interest. When reading out the buffer, the first recorded events are available for analysis.
Post-Mortem Mode and Single-Shot Recording
While Single-Shot recording allows analyzing system behaviour from a defined starting point until the SystemView buffer is filled with events, Post-Mortem Mode displays the latest system activity when reading out the data. Both modes can be useful for different purposes.
Single-Shot recording can be used to record the startup of a system and to verify a specific part of the system behaves as expected, i.e. an interrupt triggers the correct task activation.
Post-mortem mode can be useful when a system runs for a long time and suddenly crashes and for long-time tests of a system, to check and verify the system behaviour even after running for several hours.
Use cases
System Startup
With SystemView's single-shot mode the startup sequence of a system can be recorded to provide important information about initial task creation.
This information can be used to verify the system startup runs as expected, tasks are created in order with the correct priority and tasks start running after the scheduler has been started.
System Event Handling
Single-shot mode can also be used to trigger recording on a specific event, like an interrupt. The recorded information can be used to see what happens when for example data is received from an Ethernet interrupt.
It allows easy verification whether the interrupt sets the expected events which wakes the waiting tasks and handles the received data, or not.
Target Configuration
As a usual application generates about 5 to 15 kByte recording data per second and peaks only to higher rates at full load, even a small buffer in the internal RAM can be used to record data for analysis of critical parts. When using external RAM SystemView can record for a long time, even in single-shot mode. To get as much useful data for analysis as possible it is recommended to use a large buffer for SystemView, 8 kByte or more.
To configure the target system for single-shot mode, the following configuration needs to be done:
To start recording in the system call SEGGER_SYSVIEW_Start(), i.e. in main() after calling SEGGER_SYSVIEW_Conf(), or in the system when the part to be analyzed starts, i.e. in an interrupt which triggers a specific action.
For more information refer to chapter "Target configuration" of the SystemView User Manual.
Get Single-Shot Data from the System
To get the data which has been recorded in single-shot mode, the SystemView buffer has to be read via the SystemView App or an external debugger
Configure and initialize SystemView fro,m the application (SEGGER_SYSVIEW_Conf() or SEGGER_SYSVIEW_Init()).
Start recording in the application from where it should be analyzed (SEGGER_SYSVIEW_Start()).
Connect a debugger, load the target application, and let the system run.
With a J-Link the SystemView App can automatically read single-shot data from the target.
- Start SystemView and select Target → Read Recorded Data.
Without a J-Link or without the SystemView App the data can be read using following steps:
When the system crashed or all tests are done, attach with a debugger to the system and halt it.
Get the SystemView RTT buffer address and the number of bytes used (Usually _SEGGER_RTT.aUp[1].pBuffer and _SEGGER_RTT.aUp[1].WrOff).
Save the file as *.SVdat or *.bin.
Open the file with SystemView.