In the HCS08 target, A and B are two address comparators referred as triggers that make one big trigger. The trace collection starts or ends depending on the
From or
Until trigger selected along with a combination of actions involving A and B.
Both the triggers, A and B, perform the same action depending on the option selected from the
Trace Start/Stop Conditions
group. If you select the
Collect Trace From Trigger
option, both A and B are used for starting the trace collection. If you select the
Collect Trace Until Trigger
option, both A and B are used for stopping the trace collection.
If
From trigger is selected, the application activates the trace when conditions A and B are met and starts collecting the trace data.
- In the Automatically mode, if you set the Break on FIFO Full option, the application runs until the trace buffer fills and then stops automatically. If you do not set the Break on FIFO Full option, the application keeps running until you suspend it manually, but does not collect trace anymore. So either way, the trace is collected only till the trace buffer gets filled for the first time.
- In the Continuously mode, if you do not check the Keep Last Buffer Before Trigger checkbox, the application runs until the trace buffer fills. While the application is being debugged, it stops temporarily in background, resumes execution, and then collects a new buffer of trace without using triggers anymore. This new buffer of trace is collected till you manually suspend the application.
If you set the
Keep Last Buffer Before Trigger
option, the trace is collected and trace buffer is overwritten until the trigger is hit, that is until trigger conditions are met. The application stops temporarily, resumes, and collects more trace without using triggers anymore till you manually suspend the application.
Note: In the Continuously mode, the application always stops at the address where you have suspended the application manually. The application does not stop on the trigger address. The Keep Last Buffer Before Trigger option only control the data that is traced around the trigger. After the necessary trigger conditions are met, the trace data is collected normally till you suspend the application manually.
- In the Collect Data Trace mode, the data involved in a read and/or write access to the addresses specified by triggers, A and B, such as the address of a particular control register or program variable, is captured. If the Break on FIFO Full option is set, the application stops automatically, else the application stops when you suspend it manually.
If
Until trigger is selected, the application starts collecting trace and stops when conditions for A and B are met.
- In the Automatically mode, when you set the Break on Trigger Hit option, the trace gets collected until the trigger is hit, that is until trigger conditions are met. The trace buffer is overwritten during trace collection; therefore, when conditions for A and B are met, only last part of the buffer can be read. Whether the application stops automatically or manually, the trace data that is collected is only the last part of the buffer before the trigger.
Note: In the Continuously and Automatically modes, if the Instruction Execute option is selected, triggers are set on the program instruction execution. If the Memory Access option is selected, the triggers are set on memory locations and variables.
For the following trigger modes, trace starts from the triggered address rather than from the first address in the trace buffer.
- Instruction at Address A is Executed
- Instruction at Address A or at Address B is Executed
- Instruction at Address A, Then Instruction at Address B are Executed
- Instruction at Address A is Executed and Value on Data Bus Match
- Instruction at Address A is Executed and Value on Data Bus Mismatch
For the following trigger modes, the trigger address cannot be determined. Therefore, trace starts from the first entry in the trace buffer.
- Instruction Inside Range from Address A to Address B is Executed
- Instruction Outside Range from Address A to Address B is Executed
Note: For more information on trigger modes, refer
Table 1.
Warning: If you are setting breakpoints with triggers for trace control in the HCS08 target, ensure that you do not to use more than one breakpoint. This is because on HCS08, two hardware debug modules, BDC (Background debug controller) and DBG (debug module) are used. Both debug modules can be used for setting hardware breakpoints, while only DBG can be used for setting triggers. The first breakpoint is set using BDC, any other breakpoints will use DBG and will conflict with the triggers. Therefore, it is mandatory not to use more than one breakpoint when setting triggers on the HCS08 platform.