[SOLVED] Instruction Trace Only Present When Stepping Through Code

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [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!
  • 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?)
  • 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.:
    segger.com/jtrace-pro-cortex-m-setting-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
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • 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
  • Hello Charles,

    My colleague asked me to take over.

    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: segger.com/jtrace-pro-cortex-m-setting-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: wiki.segger.com/Tracing_on_NXP_Kinetis_MK21FN1M0
    Link to Ozone: 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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.