Adjusting trace timings and general troubleshooting

From SEGGER Wiki
Revision as of 09:16, 23 September 2022 by Nino (talk | contribs) (Common trace timings)
Jump to: navigation, search

This article will explain how the trace sample timing of the J-Trace Pro can be adjusted and some general troubleshooting steps if a setup does not work out-of-the-box as it would be typically expected.

Trace Timing Configuration

In some cases a target device or board design will output trace signals that do not follow the Arm trace timing requirements. If the issue is due to an incorrect sampling point in the time domain this can be fixed with J-Trace Pro's "Trace Timing Configuration" feature.

Configuration with Ozone

The recommended way is to use Ozone. It can be used directly to set the number of used trace pins and the trace sampling delay. To access this option simply open the trace project in Ozone and go to Tools->Trace Settings.

Here you can switch between different trace sources and the number of trace pins used. Default for ETM/PTM trace is Trace Source = Trace Pins and Trace Port Width = 4-bit.

To modify the trace sampling delays open the options under Trace Timing and set the the "Override Timings" checkbox. Now either one delay for all data lines can be selected or for each individually.

If you see trace data in the instruction trace window when the target device is halted and no trace related error message is printed in Ozone console the trace setup is currently stable.

Just make sure to restart the debug session each time you adjust the timing delays so they take effect.

General configuration

Via exec command

One more general way to set the delay that is Ozone independent is via an Exec Command. Such command can be used e.g. in a J-Link Script file.

Via webserver

The J-Trace Pro runs a webserver application and one of its features is to adjust the trace sampling timing.

This can be done as follows:

  • Connect the J-Trace Pro via Ethernet cable to a local area network.
  • Connect to the J-Trace Pro via J-Link Commander to find out the assigned IP address (default is DHCP mode).
J-Link commander output with assigned IP address
  • Type the assigned IP-address into your browsers address bar and press enter. The webserver should open now.
  • In the webserver main menu click on "Trace timing configuration".
J-Trace Pro webserver menu
  • Here you can now shift the sample timing to an earlier or later moment by either adjusting all or individual trace data pins.
Trace timing configuration page
  • Changes to the sampling delay will be take over immediately.
  • For verification we recommend to start the trace session with your debugger and let it halt at main.
  • If you see trace data by then without error messages from the J-Trace Pro you have a working setup.
Note:
The settings via webserver are not permanent. If you want to set the values permanently try the approach explained above. The Half-Sync detection on the webserver can be ignored and is only used for internal testing at SEGGER.

Common trace timings

The following list shows common timing types that get output by some devices. You can use this charts to determine to which Type the microcontroller you are using belongs to by measuring with an oscilloscope. In most cases there are no additional actions required by the user to fix trace timing errors output by the microcontroller. Should trace not work out-of-the-box with the J-Trace PRO after initializing all pins and clocks correctly please refer to section Troubleshooting.

Most Arm microcontrollers follow the rule that their trace clock speed is the current CPU frequency divided by two. In some other rare cases the microcontroller divides the trace clock even further or has a fixed clock value.

Trace signal quality

The good

The bad

The ugly

Troubleshooting

FAQ