Task Testing Panel¶
Overview¶
The Task Testing panel is used to test a single Sensor Controller task on a physical CC26xx/CC13xx device. During task testing, Sensor Controller Studio takes over the role of the System CPU application and interacts with the Sensor Controller task through an XDS100, XDS110 or XDS200 JTAG debug probe.
The Task Testing panel runs whole iterations of the Initialization Code , Execution Code , Event Handler Code and Termination Code task code blocks, and captures all task data structure values between task iterations . The data structure values are displayed graphically in Task Testing panel’s Graph tab, and can be also saved to file for external analysis.
It is also possible to automatically apply new data structure values loaded from file between specific task iterations.
For low-level debugging of a task, it is possible to run single iterations of the task code blocks in debug mode. This activates the Task Debugging Panel .
Shortcut : Ctrl + T
Setup¶
Task Selection¶
Select a project and task to trigger code generation.
The code generation log is displayed if any errors occur.
Task Testing Workflow¶
It is possible to select two different workflows for the Task Testing panel:
- The low-level flow, where the Initialization Code and Termination Code must be triggered manually
- Allows for debugging of the Initialization Code and Termination Code
- The simplified flow, where the Initialization Code and Termination Code are triggered automatically
- Does not allow debugging of the Initialization Code and Termination Code
The workflow diagram displays the task testing session states, and when and for what purpose the commands are used.
Task Iteration Action Sequence¶
The Task Testing panel runs the Execution Code and/or Event Handler Code task code blocks as part of a task iteration .
When taking over the role of the System CPU application during task testing and debugging, Sensor Controller Studio cannot interact with the Sensor Controller in real-time, and also has no knowledge of what iterations of a particular task (during task testing) actually consist of. This sequence/flow of events must therefore be specified before task testing can begin.
Add actions to the Task iteration action sequence list to specify the task testing iteration in detail. Actions include:
- Running Execution Code or Event Handler Code. The Event Handler Code runs only after the specified trigger has occurred.
- Conditional execution of actions, based on a small set of relevant criteria.
- Repeated execution of actions, based on a small set of relevant criteria.
- Waiting for a delay to expire and/or an event to occur.
Some examples of task iterations are given below:
// Simple example:
Run Execution Code
// Another simple example:
Run Execution Code
Run Event Handler A Code (trigger 0)
// Advanced example:
While no ALERT generated {
Run Execution Code
Wait for event trigger 0 for 1000 ms
If event trigger 0 occurred {
Event Handler A Code (trigger 0)
}
}
Sensor Controller Studio clears the ALERT interrupt before each task iteration. It is not cleared at any point while running the task iteration action sequence.
When triggering debugging of a task iteration that runs multiple task code blocks, the blocks are debugged in order. The title bar in the Task Debugging Panel displays which task code block is currently being debugged.
The iteration action sequence list is saved for each task in the project file.
Task Iteration Timing¶
By default, the task iteration action sequence will run at a 200 millisecond minimum interval.
The minimum task iteration interval can be changed, between 10 and 10000 milliseconds, in the bottom right corner of the Task Testing panel, or in the Preferences panel.
Note that the timing is not precise:
- The timing is controlled by the host computer, and runs off a normal timer (that is, not a multimedia timer)
- The interval can increase when:
- A task iteration takes more time to complete than the configured interval
- There are large data structures, which must be transferred to the host computer between each iteration
- There are many graph lines to draw, with many data points in view
For precise execution timing, use run-time logging instead of task testing.
Target Interaction Commands¶
The Task Testing panel can be in one of the states listed below. Each state enables a subsets of the task testing commands, which can be triggered from the Task Testing menu, the panel tool bar or keyboard shortcuts:
Low-Level Workflow¶
- Disconnected with unsuccessful code generation
- All commands disabled
- Disconnected with successful code generation
- Connect -
F12
: Connect to the target (a target selection window appears if JTAG debug probe firmware update is needed or multiple targets are available)
- Connect -
- Connected, task inactive
- Run Initialization Code -
F6
: Run the Initialization Code once - Debug Initialization Code -
Ctrl+F6
: Run the Initialization Code once in the Task Debugging Panel - Disconnect -
F12
: Disconnect from the target
- Run Initialization Code -
- Connected, task active
- Run Task Iterations Continuously -
F5
: Run task iterations continuously (Execution Code and/or Event Handler Code) - Run One Task Iteration -
F11
: Run one task iteration (Execution Code and/or Event Handler Code) - Debug One Task Iteration -
Ctrl+F11
: Run one task iteration in the Task Debugging Panel (Execution Code and/or Event Handler Code) - Run Termination Code -
F6
: Run the Termination Code once - Debug Termination Code -
Ctrl+F6
: Run the Termination Code once in the Task Debugging Panel - Disconnect -
F12
: Disconnect from the target
- Run Task Iterations Continuously -
- Connected, task active, running Execution Code continuously
- Stop Continuous Task Iterations -
F6
: Stop task iteration continuous run (Execution Code and/or Event Handler Code) - Disconnect -
F12
: Disconnect from the target
- Stop Continuous Task Iterations -
- Connected, debug session in progress
- All commands disabled
Simplified Workflow¶
- Disconnected with unsuccessful code generation
- All commands disabled
- Disconnected with successful code generation
- Connect -
F12
: Connect to the target and run the Initialization Code (a target selection window appears if JTAG debug probe firmware update is needed or multiple targets are available)
- Connect -
- Connected, task active
- Run Task Iterations Continuously -
F5
: Run task iterations continuously (Execution Code and/or Event Handler Code) - Run One Task Iteration -
F11
: Run one task iteration (Execution Code and/or Event Handler Code) - Debug One Task Iteration -
Ctrl+F11
: Run one task iteration in the Task Debugging Panel (Execution Code and/or Event Handler Code) - Restart Task -
F7
: Restart task by running the Termination Code and Initialization Code - Disconnect -
F12
: Disconnect from the target
- Run Task Iterations Continuously -
- Connected, task active, running task iterations continuously
- Stop Continuous Task Iterations -
F6
: Stop task iteration continuous run (Execution Code and/or Event Handler Code) - Disconnect -
F12
: Disconnect from the target
- Stop Continuous Task Iterations -
- Connected, debug session in progress
- All commands disabled
Graph¶
The Graph tab in the Task Testing panel displays data structure member values for each task iteration as line graphs.
Data Structure Member Selection and Editing¶
Select data structure members for graphical display by checking and unchecking these in the list to the right. All data structure members are logged, and the selection can be changed at any point without losing data.
The data structure list normally displays the data structure values before the next task iteration. While not running, these values can be edited:
- To start editing: Select the data structure member to be edited and press Enter , or double-click on the data structure member value.
- To finish editing: Press Enter .
- To cancel editing: Press Esc or select a different data structure member.
The data structure list can also display the data structure member values at a particular point in the graph. Click and hold the left mouse button in the graph area to view the values at that point. This temporarily disables auto-scrolling.
Zooming and Scrolling¶
Use the mouse scroll wheel to zoom and scroll in the graph:
- While pressing no keys: Scroll vertically
- While pressing Ctrl : Zoom vertically
- While pressing Shift : Scroll horizontally
- While pressing Ctrl + Shift : Zoom horizontally
When auto-scrolling is enabled (on by default), the graph area scrolls to the right automatically when new vectors are added to the graph. Use the Auto-Scroll command to toggle this behavior.
When auto-scaling is enabled (off by default), the Y-axes will scale to the currently visible values. Otherwise, the Y-axes will cover all observed values along the entire X-axis. Use the Auto-Scale command to toggle this behavior.
Graph Customization¶
The Customize Graphs… command allows for different data structure members to be displayed together in one graph section.
Each data structure member that can be selected in the Task Testing panel’s data structure tree view can be used as a parent graph .
For each parent graph it is possible to add one or more child graphs , that is any data structure member within the same task. For each child graph it is possible to specify:
- A label to be displayed in the data structure tree view. If no label is specified, the child graph name is used.
- Scaling factor and offset, which allows the value range of the child graph to be matched to the value range of the parent graph. Values of the selected data structure member are first multiplied by the scaling factor, and then the offset is added.
Child graphs are shared between task testing and run-time logging.
Child graphs are displayed when the associated parent graph data structure members are selected.
Child graphs are removed automatically if data structures are changed so that the selected parent graph and/or child graph no longer exist.
Data Handling Commands¶
The following commands can be used to load data vectors (an arbitrary subset of the task’s data structure members) to be applied before task code iterations, and to cancel such loading. The commands take effect the next time the Initialization Code is run:
- Load Pre-Iteration Vector Input : Load pre-iteration vector input from CSV file (data structure contents to be applied before each iteration)
- Clear Pre-Iteration Vector Input : Clear pre-iteration vector input loaded from CSV file (data structure contents to be applied before each iteration)
The following commands can be used to save data vectors (all of the task’s data structure members) captured after each task code iteration.
- Save Post-Iteration Vectors : Save post-iteration vectors to CSV file (data structure contents after each iteration)
- Clear Post-Iteration Vectors : Clear post-iteration vectors (data structure contents after each iteration)
Input CSV File Format¶
The CSV files are formatted as follows:
- The first row specifies the member name for each column (for example “cfg.hysteresis” or “cfg.pBinThresholds.[2]”).
- A special, optional first column “index” can be added to specify when each vector shall be applied (index N corresponds to vector N)
- Vector 0 is applied before running the Initialization code, and then vector N before the N’th iteration of the Execution code
The CSV column separation character is “;” by default. The character can be changed in the Preferences Panel .