Trace From Trigger A Onward

To set trigger A in the Automatic (One-buffer) mode in the Disassembly view:

  1. In the CodeWarrior Projects view, select the Sources folder of your project.
  2. Double-click the source file, for example, main.c to display its contents in the editor area. Replace the source code of the main.c file with the source code shown in Listing: Source code for trace collection.
  3. Save and build the project.
  4. Open the Debug Configurations dialog box, and select your project in the tree structure.
  5. Click the Trace and Profile tab, and check the Enable Trace and Profile checkbox.
  6. Select the Automatic (One-buffer) option from the Select Trace Mode group.
  7. Check the Halt the Target when Trace Buffer Gets Full checkbox.
  8. Select Trace from Trigger A Onward from the Trace Start/Stop Conditions drop-down list.
  9. Click Apply to save the settings.
  10. Click Debug to debug the application.
  11. In the Disassembly view, right-click the marker bar corresponding to the statement, f2(); before for(;;).
    Figure 1. Setting Trigger A in Disassembly View
    Setting Trigger A in Disassembly View
  12. Select the Trace Triggers > Toggle Trace Trigger A option from the context menu. The trigger A icon appears in green color on the marker bar, in the editor area and the Disassembly view.
  13. Click Resume. The application stops automatically after some time.
    Note: Because you selected the Halt the Target when Trace Buffer Gets Full check box in the Trace and Profile tab, the application will stop automatically after the trigger hit. You do not need to stop it manually by clicking Suspend.
  14. Open the Trace Data viewer following the steps explained in the topic Viewing Data to view the trace results.

The figure below shows the data files that are generated by the application in which the data has been collected after setting trigger A in Disassembly view, and selecting the Automatic (One-buffer) mode. The figure shows that the trace data starts collecting from trigger A. The application stops automatically when the trace buffer gets full and the trace data is collected till that trace buffer.

The graph in the following figure shows the timeline of the trace data. In this graph, you can see that the trace data starts collecting from the f2() function and stops when the trace buffer gets full.

Note: If you choose to not check the Halt the Target when Trace Buffer Gets Full checkbox, the trace buffer gets overwritten. Therefore, only the last part of the trace data executed before the application suspends is visible in the Trace Data viewer.
Figure 2. Trace Data After Setting Trace From Trigger A Onward in Automatic Mode
Trace Data After Setting Trace From Trigger A Onward in Automatic Mode
Figure 3. Timeline Data After Setting Trace From Trigger A Onward in Automatic Mode
Timeline Data After Setting Trace From Trigger A Onward in Automatic Mode

This is how you collect trace data in the Automatic (One-buffer) mode of the ColdFire V1 target.

Note: Similarly, you can set the Trace from Trigger B Onward trace condition in both Continuous and Automatic modes and collect the trace data.