Trace From Trigger A Onward

To set trigger A in the editor area for the ColdFire V1 target:

  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 below.
    Listing: Source code for trace collection
    #include <hidef.h> /* for EnableInterrupts macro */
    
    #include "derivative.h" /* include peripheral declarations */
    
    volatile int a, b, c, i;
    
    void f()
    {
      c=1;
      c=2;
      c=3;
    }
    
    void f1()
    {
      b=1;
      b=2;
      b=3;
    }
    
    void f2()
    {
      a=1;
      a=2;
      a=3;
    }
    
    void main(void) {
      EnableInterrupts;
     /* include your code here */
     for(i=1;i<10;i++)
     {
       f();
     }
    
     f2();
    
     for(;;) {
        __RESET_WATCHDOG();/* feeds the dog */
    
        f1();
        f2();
      } /* loop forever */
    }
    
  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. Click Apply to save the settings, and close the Debug Configurations dialog box.
  7. In the editor area, select the statement, f2(); (before the for (;;) statement).
  8. Right-click the marker bar, select the Trace Triggers > Toggle Trace Trigger A option from the context menu. The trigger A icon appears on the marker bar in green color. The same option is also used to remove trigger A from the marker bar.
    Figure 1. Trigger A Set in Editor Area
    Trigger A Set in Editor Area
    Note: Do not set tracepoints on the statements containing only comments, brackets, and variable declaration with no value. If tracepoints are set on invalid statements, they are automatically disabled when the application is debugged.
  9. Open the Debug Configurations dialog box, click the Trace and Profile tab.
  10. Select the Continuous option from the Select Trace Mode group.
  11. Select the Trace from Trigger A Onward option from the Trace Start/Stop Conditions drop-down list.
  12. Click Debug to debug the application.
  13. Click Resume to resume the application and after a short while, click Suspend .

    The trace data is collected in the data files.

  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 file generated by the application in which the data has been collected after setting trigger A in the source code. In this data file, the Description column shows that trace starts collecting from f2(), where you set trigger A. Because you selected the Trace from A Onward option, the trace data starts collecting from f2() and stops when you suspend the application. The following figure shows the timeline data.

    Figure 2. Trace Data After Setting Trace From Trigger A Onward in Continuous Mode
    Trace Data After Setting Trace From Trigger A Onward in Continuous Mode
    Figure 3. Timeline Data After Setting Trace From Trigger A Onward in Continuous Mode
    Timeline Data After Setting Trace From Trigger A Onward in Continuous Mode
  15. Click the Terminate button in the Debug perspective to terminate the application.

This is how you set the Trace From Trigger A Onward trace conditions in the Continuous mode of the ColdFire V1 target and collect trace data.