Monday, May 21st 2018, 9:09am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

cguan

Beginner

Date of registration: Mar 23rd 2017

Posts: 6

1

Monday, April 3rd 2017, 10:22pm

[SOLVED] Instruction Trace Only Present When Stepping Through Code

I'm trying to use a J-Trace to view the instruction trace on a program. It appears to show the trace properly when stepping through code or very short runs between breakpoints. However, if I run and then halt the program, the instruction trace has no data.

Is it necessary to use a J-Trace PRO? I had thought that the J-Trace would drop some instructions but still show the most recent instructions. Thanks for your help!

cguan

Beginner

Date of registration: Mar 23rd 2017

Posts: 6

2

Tuesday, April 4th 2017, 2:39am

Instruction Trace works at lower clock speed

When I lower the clock speed from 120 MHz to 48 MHz, the instruction trace shows up properly. Do you have any advice for making instruction trace work reliably at higher clock speeds (I can't change the circuit board now but are there configurable J-Trace settings?)

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,516

3

Tuesday, April 4th 2017, 8:56am

Hi,

Sounds like the trace timing on the device you are using is not good.
If you have a J-Trace PRO, you can adjust the trace timing, to make things working even if the device is outputting trace data outside the trace spec.:
https://www.segger.com/jtrace-pro-cortex…g-up-trace.html
(See troubleshooting area at the bottom)

Please note that the adjustment of the trace timing is not available on the non-PRO version of J-Trace.

What device are you using? (Manufacturer + device name)


Best regards
Alex

cguan

Beginner

Date of registration: Mar 23rd 2017

Posts: 6

4

Tuesday, April 4th 2017, 6:25pm

Hi Alex,

Thanks for the prompt reply. Is it possible to at least check whether the half-sync pattern is being detected on the non-Pro J-Trace?

I am using a Freescale Kinetis K21F. A simple TWR board example worked, but our custom PCB only works at 48MHz. Thanks!

Best,
Charles

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

5

Wednesday, April 5th 2017, 10:48am

Hello Charles,

My colleague asked me to take over.

Quoted

Thanks for the prompt reply. Is it possible to at least check whether the half-sync pattern is being detected on the non-Pro J-Trace?

Unfortunately this feature is streaming trace exclusive which is only supported by the J-Trace PRO.
As Alex wrote in the earlier reply at least one of the trace signals is not meeting the trace timing specifications listed here: https://www.segger.com/jtrace-pro-cortex…g-up-trace.html
This can happen if the trace signals get delayed by different electronic components that are attached at the trace lines, like diodes, capacitors or even other ICs that share the pins.
To find out how the trace signals behave i suggest using a oscilloscope and measure their respective setup times and rise times.
Depending on the IDE you are using you could also try to implement only 1- or 2- bit trace. If you are lucky only the higher trace bits do not meet the timing requirements so you can still trace with full speed but fewer pins.

I set up an example project that works IDE independent in our Ozone debugging tool (free tool for J-Trace customers) so you can use it for further signal debugging.
Link to project: https://wiki.segger.com/Tracing_on_NXP_Kinetis_MK21FN1M0
Link to Ozone: https://www.segger.com/downloads/jlink#Ozone
It runs at 120 MHz cpu clock and 60 MHz trace clock.
To set the trace port width in this example edit the NXP_Kinetis_K21FN1M0_TraceExample.JLinkScript file by going to row 53 where you will find the entry "//JLINK_TRACE_PortWidth = 4;"
If you want to use 1-bit trace, uncomment that line and instead of the 4 write a 1 like this: "JLINK_TRACE_PortWidth = 1;"

If only the higher bit tracelanes are affected by timing problems, trace with the maximum possible trace clock should now work.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/