Configure HCS08 Target

To configure the launch configuration for the HCS08 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 configuration in the tree structure on the left, and select the launch configuration corresponding to the project you are using. For example, select proj-HCS08_FLASH_PnE U-MultiLink.
  3. On the Main tab page, verify that proj-HCS08 is displayed in the Project field. If it does not appear, click Browse and locate the project.
  4. If the application is not displayed in the Application field, click Search Project to select the application image.
    Figure 1. Debug Configurations - Main Page
    Debug Configurations - Main Page

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 to enable the Trace Mode Options and Trace Start/Stop Conditions groups.
    Figure 2. Debug Configurations - Trace and Profile Page (HCS08)
    Debug Configurations - Trace and Profile Page (HCS08)

The table below describes the various Trace and Profile options.

Table 1. Trace and Profile Options for HCS08
Group Options Descriptions
User Options Enable Logging When checked, 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.
Configuration Set in User Code When checked, lets you configure trace registers from the application without using the Trace and Profile page. In this scenario, you can write the appropriate registers in the source code to configure the trace mode and triggers.

To understand how to configure trace registers in the application for the HCS08 target, refer Configuring Trace Registers in Source Code.

Trace Mode Options Collect Program Trace Consists of these options:
  • Continuously - When selected, collects the trace data continuously. The trace buffer is read, processed, and emptied periodically, so that the Trace Data viewer can collect all the trace records generated by the application. In this mode, the trace data is not lost. It is a bit intrusive as it stops the target repeatedly in the background for collecting the trace buffers.
  • Automatically - When selected, the entries in the buffer start overwriting without interruption when the data reaches at the end of the buffer. If there is more trace data than the size of the buffer, the old entries will be overwritten.
  • LOOP1 Mode - Lets you collect the trace data 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.
For more information, refer MC9S08QE128 Reference Manual. NOTE: The LOOP1 Mode option is visible only for the debug version 3 (DbgVer 3) targets, that is HCS08 target with three comparators. For any other targets with two comparators, this option is not visible.
Collect Data Trace Collects the trace data of the values of a variable, which is located at the address where trigger B is set, for all the accesses (Read/Write/Both).
Profile-Only When selected, collects trace by sampling the program counter (PC) from time to time.
Expert When selected, enables the Configure Expert Settings button and gives you access to most of the on-chip DBG module registers. To configure expert settings, download the processor specific manual from the site: http://www.freescale.com/
Trace Start/Stop Conditions No Trigger Specifies that no triggers are set for collecting trace. When no triggers are set and trace is collected, the trace data starts collecting from the beginning of the application.

For more information on tracepoints, refer Setting Tracepoints (HCS08).

Collect Trace From Trigger Starts collecting trace when the triggers generate, that is when the condition for A and B is met.

For more information on tracepoints, refer Setting Tracepoints (HCS08).

 
Break on FIFO Full While debugging, suspends the application automatically when buffer gets full. The checkbox gets enabled in the Automatically mode when the Collect Trace From Trigger option is selected.
Collect Trace Until Trigger Starts collecting trace and stops when the condition for triggers, A and B is met. This option is not enabled in the Continuously mode.

For more information on tracepoints, refer Setting Tracepoints (HCS08).

Break on Trigger Hit While debugging, suspends the application automatically when the trigger is hit, that is when the trigger condition is met. The checkbox gets enabled when the Collect Trace Until Trigger option is selected.
Trigger Type   Contains various conditions of triggers, A and B for starting/stopping trace collection.

For more information on tracepoints, refer Setting Tracepoints (HCS08).

Instruction at Address A is Executed Starts trace from the address or source line corresponding to trigger A. For more information, refer Setting Triggers in Automatically Mode.
Instruction at Address A or Address B is Executed Starts trace from the address or source line corresponding to trigger A or trigger B whichever occurs first.

For more information, refer Instruction at Address A or Address B is Executed.

Instruction Inside Range from Address A to Address B is Executed Starts trace when any instruction in the range between trigger address A and trigger address B is executed. That is, when [address at trigger A] <= [current address] <= [address at trigger B]

For more information, refer Instruction Inside Range from Address A to Address B is Executed.

NOTE: For the MC9S08PT60 target, the Instruction Inside Range from Address A to Address B is Executed trigger will hit when any instruction inside the range between trigger address A and trigger address B matches with the data on the bus or program address inside the range.

Instruction Outside Range from Address A to Address B is Executed Starts trace when any instruction outside the range between trigger address A and trigger address B is executed. That is, when [current address] < [address at trigger A or address at trigger B] < [current address].

For more information, refer Instruction Outside Range from Address A to Address B is Executed.

NOTE: For the MC9S08PT60 target, the Instruction Outside Range from Address A to Address B is Executed trigger will hit when any instruction outside the range between trigger address A and trigger address B matches with the data on the bus or program address outside the range.

  Instruction at Address A, Then Instruction at Address B are Executed Starts trace from trigger B only if trigger A occurred before.

For more information, refer Instruction at Address A, Then Instruction at Address B are Executed.

Instruction at Address A is Executed and Value on Data Bus Match Collects the trace data from the instruction where trigger A is set when the value specified in the Value to Compare on Data Bus text box matches with the opcode read from trigger A address, that is the value in memory at trigger A address. For more information, refer Instruction at Address A is Executed and Value on Data Bus Match.

NOTE: Because the hardware has a small delay in enabling the triggers, trace won't be collected as expected if data match is done for the instruction immediately following the line where trigger is set.

Instruction at Address A is Executed and Value on Data Bus Mismatch Collects the trace data from the instruction, where trigger A is set, on data mismatch. That is, trace is triggered at address A when the value specified in the Value to Compare on Data Bus text box does not match with the opcode read from trigger A address.

For more information, refer Instruction at Address A is Executed and Value on Data Bus Mismatch.

Value to Compare on Data Bus Contains the value that you specify to be matched or not matched with the opcode read from trigger A address.
Capture Read/Write Values at Address B Captures accesses to the variable address, where trigger B is set, after you press resume. Appears only when the Collect Data Trace mode is selected.

For more information, refer Capture Read/Write Values at Address B.

Capture Read/Write Values at Address B, After Access at Address A Waits for the program to execute the instruction at the address where trigger A is set, monitors the variable address where trigger B is set, and collects trace from there. Appears only when the Collect Data Trace mode is selected.

For more information, refer Capture Read/Write Values at Address B, After Access at Address A.

Trigger Selection Instruction Execute This option is related to how the hardware executes triggering. An address is triggered only when the opcode is actually executed, but this circuitry has a delay which sometimes makes the very next instruction in memory not caught in the trace when you press resume. In this mode, the output of the comparator must propagate through an opcode tracking circuit before triggering FIFO actions.
Memory Access When selected, allows memory access to both variables and instructions.

For more information, refer Memory Access Triggers.

Note: The Trigger Selection group is disabled if the No Trigger option is selected in the Trace Start/Stop Conditions group.