From Trace and Profile Tab - Kinetis Cortex M0+ Core

This topic explains how to set comparator 1 and comparator 2 as hardware tracepoints for collecting trace on a Kinetis Cortex M0+ project.

This topic uses the addresses of the instructions, of Listing: Source code for trace collection, at which you set start and stop hardware tracepoint. These addresses will be set against comparator 1 and comparator 2 to collect the same trace results that appear on setting hardware tracepoints from the source code.

To set hardware tracepoints using the Trace and Profile tab and collect trace on a Kinetis Cortex M0+ project:

  1. Select your project and open the Debug Configurations dialog box.
  2. Enable tracing and profiling using steps 3 - 11 of Configuring Kinetis Cortex M0+ Core.
  3. Close the Debug Configurations dialog box.
  4. In the CodeWarrior Projects view, right-click the .elf file of your project, and select the Disassemble option.

    The disassembly file of the project opens automatically.

  5. Search for the string entry().
  6. Look for the address of the second call to Performance1(). For example, 0x8ce.
  7. Look for the address of the first assembly instruction of the line if (iteration >= 255) iteration = 0;. For example, 0x90a.
  8. Open the Debug Configurations dialog box, and select the Trace and Profile tab.
  9. Click Advanced Settings to open the Preferences dialog box displaying the MTB settings.
  10. Select DWT comparator 1 as Start Resource and DWT comparator 2 as Stop Resource.
  11. In the Comparator 1 tab, select Instruction Fetch from the Generate Comparator Match Event On drop-down box.
  12. In the Value text box, specify the address of the instruction on which you want to set comparator 1. For example, 0x000008CE, which is the address of the second call to Performance1().
    Figure 1. Setting Comparator 1 — MTB Settings
    Setting Comparator 1 — MTB Settings
  13. In the Comparator 2 tab, select Instruction Fetch from the Generate Comparator Match Event On drop-down box.
  14. In the Value text box, specify the address of the instruction on which you want to set comparator 2. For example, 0x0000090A, which is the address of the first assembly instruction of the line if (iteration >= 255) iteration = 0;.
  15. Click OK and close the Preferences dialog box.
  16. Debug the application.
  17. Click Resume and after a few seconds, click Suspend.
  18. In the Software Analysis view, expand the project name and click the Timeline hyperlink.

    The Timeline viewer appears displaying the results shown below.

    Figure 2. Timeline Results After Setting DWT Triggers on Kinetis Cortex M0+ Project
    Timeline Results After Setting DWT Triggers on Kinetis Cortex M0+ Project