Configure S12Z Target

To configure the launch configuration for the S12Z target:

  1. In the CodeWarrior Projects view, right-click the project and select Debug As > Debug Configurations from the context menu.

    The Debug Configurations dialog box appears.

  2. In the Debug Configurations dialog box, expand the CodeWarrior Download configuration in the tree structure on the left, and select the launch configuration corresponding to the project you are using. For example, select S12z_FLASH_PnE U-MultiLink.

To configure the launch configuration for the measurement of data:

  1. Click the Trace and Profile tab.
  2. Check the Enable Trace and Profile checkbox.
    Figure 1. Trace and Profile Tab Options of S12Z
    Trace and Profile Tab Options of S12Z

The table below describes the various Trace and Profile options for S12Z architecture.

Table 1. Trace and Profile Options for S12Z
Group Option Description
User Options Enable Logging Creates a log file that keeps details of the actions that took place in the application. For example, when the debug session terminated, when the target execution resumed or stopped.
Target Configuration Continuous trace collection Allows you to collect continuous trace data when checked. That is, it stops the target in the background to read the trace every time the FIFO is almost full.
Enable Timsestamps Enables time stamping when checked.
Stop on buffer full Suspends the target automatically and stops trace collection when buffer is full.
Trace Mode   Allows you to select any one of the following trace modes:
  • Normal - collects trace in normal mode and stores change of flow (COF) program counter (PC) addresses.
  • Loop1 - lets you collect trace without any consecutive identical addresses. If the next address to be stored in FIFO is the same as the one stored last time, it is ignored. This mode is particularly useful with short busy-wait type loops, which are repeated a large number of times or recursive calls, and is recommended when you want to view the coverage of that code, but not necessarily the number of times the code executed.
  • Detail - allows you to capture specific values using triggers. When selected, enables Trace from: 0x and to: 0x where you can specify the limit of the addresses for which you want to collect trace.
  • Pure PC - collects trace in normal mode without timestamps.
Trigger Mode   Allows you to select any one of the following triggers for the trigger set in the source code:
  • End Trigger - collects trace data after the trigger is hit
  • Start Trigger - collects trace data until the trigger is hit.
  • Middle Trigger - collects some data until the trigger is hit and some data after the trigger hits.
Trace from: 0x   Specifies the address from which you want to collect trace data.
to: 0x   Specifies the address till which you want to collect trace data.
State 1, 2, 3 Next State for Comp A/B/C/D Specify the logic for starting the trace collection. The trace collection starts when the target enters the Final State . The drop-down lists for each state allows you to select the next state when the corresponding comparator is hit.

For example, in the State 1 tab, you select Next State for Comp A as State 2 , that is when comparator A is hit you want to enter State 2 . Then in the State 2 tab, when comparator B is hit, you want to enter State 3 . Then in State 3 when comparator C is hit, you want to enter the Final State and begin collecting trace.

NOTE: The comparators are the triggers A,B,C,D, which you can set in the source code, on variables, or in memory. To set triggers in the source code, select Trace Triggers > Toggle Trace Trigger A/B/C/D.

Note: On S12z platform, breakpoints and triggers are mutually exclusive. You may use only breakpoints or only triggers but never both during debugging a S12z application.