Capture Read/Write Values at Address B, After Access at Address A

This option captures the data involved in a read and/or write access to the addresses specified by trigger B after the instruction at trigger A address has been executed. To capture read/write values at trigger B after trigger A in the Collect Data Trace mode:

  1. In the CodeWarrior Projects view, expand 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 in the main.c file with the source code shown in Listing: Source code 4.
  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, right-click the marker bar corresponding to the statement as highlighted in the figure below.
    Figure 1. Setting Trigger A in Collect Data Trace Mode
    Setting Trigger A in Collect Data Trace Mode
  8. Select Trace Triggers > Toggle Trace Trigger A from the context menu.
  9. Open the Debug Configurations dialog box, and click the Trace and Profile tab.
  10. Select the Collect Data Trace option in the Trace Mode Options group.
  11. Select Collect Trace From Trigger in the Trace Start/Stop Conditions group.
  12. Check the Break on FIFO Full checkbox.
  13. Select Capture Read/Write Values at Address B, After access at Address A from the Trigger Type drop-down list.
  14. Click Apply to save the settings.
  15. Click Debug to debug the application.
  16. Perform steps 12 - 17 of the Capture Read/Write Values at Address B topic. After setting triggers, A and B, the Analysispoints view contains the following entries.
    Figure 2. Analysispoints View with Trigger A and Trigger B
    Analysispoints View with Trigger A and Trigger B
  17. Click Resume.

    The application waits for the instruction at trigger A address to execute, monitors the address of iteration, collects the trace data till buffer gets full, and then stops automatically.

  18. 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 generated by the application after setting triggers A and B in the Collect Data Trace mode. The trace data that is collected contains values of iteration starting from 2. This is because iteration has been incremented twice by the time application reaches the address where trigger A is set.
    Figure 3. Trace Collected at Address B, After Access at Address A
    Trace Collected at Address B, After Access at Address A
  19. Click Resume again.

    The application captures more data and stops automatically.

  20. Open the Trace Data viewer and see new data being appended to the old data.
    Figure 4. Trace Collected at Address B, After Access at Address A - New Data Appended
    Trace Collected at Address B, After Access at Address A - New Data Appended

This is how you collect trace using the Capture Read/Write Values at Address B, After Access at Address A trigger type.

Note: With a trigger condition selected, full trace is collected even when no triggers are set. That is, if you specify a trigger condition in the Trace and Profile tab of the Debug Configurations dialog box, but do not set the trigger in the application then full trace data will be collected from the beginning of the application.