To enable software tracepoints automatically, you can use the Software Tracepoints Support
dialog box, which appears when you add first start software tracepoint on a project in the source code. You can also invoke the dialog box by selecting the project in CodeWarrior Projects
view, right-click it, and select the Profiler > Add software tracepoint support
option.
This dialog box:
Perform the following steps to enable software tracepoints automatically and collect trace data. The steps are same for Freescale as well as GCC toolchain.
- Open the Debug Configurations dialog box, and select your project in the tree structure.
- Click the Trace and Profile tab, and check the Enable Trace and Profile checkbox.
- Check Continuous Trace collection and uncheck all other checkboxes.
- Click Apply to save the settings, and close the Debug Configurations dialog box.
- In the editor area, select this statement: int counter = 0;
- Right-click the marker bar, select the Toggle Trace Start Point > Software Trace Point option from the context menu. The same option is also used to remove the start tracepoint from the marker bar.
The Software Tracepoints Support
dialog box appears.
Note: If you click
Cancel in the
Software Tracepoints Support dialog box, the start tracepoint is set in the source code, but you are required to enable the software tracepoints functionality manually as discussed in
Setting Software Tracepoints Manually.
Figure 1. Software Tracepoints Support Dialog Box 
- Click Locate to search for the source file where the interrupt vector is declared.
- Select kinetis_sysinit.c file in the dialog box that appears.
- Click OK in the Software Tracepoints Support dialog box.
- In the editor area, select this statement: for(;;)
- Right-click the marker bar, select the Toggle Trace Stop Point > Software Trace Point option from the context menu.
- Debug the application.
- Collect trace and profile results.
- Click Resume.
- Click Suspend after a few seconds.
- In the Software Analysis view, expand the project name and click the Trace hyperlink.
The Trace Data
viewer appears.
This is how you set software tracepoints automatically on the Kinetis architecture.