[SOLVED] "Unknown trace data packet detected" happens once in a while

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

  • [SOLVED] "Unknown trace data packet detected" happens once in a while

    Hello,

    We are encountering the error message below when fetching traces, not all the time but only a tiny fraction of the time:
    LTRACE (Time since start: 1.172 679, Thread=ETM3): Unknown trace data packet detected (Offset = 0x102C3, Data = 0x00)
    Parts of it change every time, like the time, thread ETM number, and offset.

    We use the J-Link SDK, and in our use case we fetch traces from the unit around ten times a minute using the STRACE API, specifically the --removed by moderator as discussing J-Link SDK API publicy is a license violation-- function of the J-Link DLL, which is the call that sometimes fails.
    In our use, the unit gets reset regularly and tracing is started and stopped just as often.
    The trace data we get is valid when the call succeeds. When we run tracing continuously, we usually get the error within 5 to 20 minutes.

    We have the following setup:
    Probe: J-Trace PRO V2 Cortex-M compiled Nov 12 2020, Hardware version V2.00 (see additional screenshot attached)
    DLL version: V6.89b, compiled Dec 3 2020
    Board: ADI ADuCM362, Cortex-M3

    We are in the process of setting up a scope to look at the signal quality and timings, but because it works a large portion of the time, we think it could be difficult to identify an issue there.

    Is there something we could be doing wrong, and what should be our next step to solve this issue?

    Thank you,
    Johan
    Images
    • jlink-setup2.PNG

      100.25 kB, 1,000×528, viewed 170 times
    • fail-trace2.PNG

      16.82 kB, 887×186, viewed 89 times
    • fail-trace1.PNG

      10.97 kB, 805×145, viewed 84 times

    The post was edited 1 time, last by jmnl29 ().

  • Hello Johan,

    Thank you for your inquiry.
    Unknown Trace Packets usually indicate a signal integrity issue so incorrect packets are sampled by the J-Trace Pro.

    Troubleshooting steps can be found here:
    wiki.segger.com/J-Trace_overflow_error

    As the issue appears only rarely for you it is most likely sufficient to adjust the sampling delay slightly as explained in the guide.

    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.
  • Thank you for the response, I have tried adjusting the sampling delay (in the range 0-10000), and while it seemed to help (5000ps gave - I think - fewer errors than 0ps), the issue still happens with some regularity.

    We also had a look at the trace signals with a scope, and it looked ok on each trace pin, and seemed to be well synchronized with the trace clock - see the attached pictures (sorry for their poor quality and labelling). We are going to look harder into this though.

    I also noticed that the trace frequency (as returned by the function that starts the tracing) seems to vary a lot: I've seen it be 8Mhz, 500kHz and 490kHz. Our core runs at 16Mhz, so from the wiki page you linked I would have expected it to be 8Mhz every time. Do you know why it would change this way, and if it could be an issue?

    Last observation, when we get the error and press OK, the traces we receive actually look good - none missing, and their data makes sense.
    I have tried enabling Batch Mode, but it doesn't seem to stop the dialog box from appearing - is there any way around this blocking error box?

    Thank you,
    Johan
    Images
    • traceclk.jpg

      517.15 kB, 4,096×2,304, viewed 93 times
    • clk_and_pin.jpg

      509.99 kB, 4,096×2,304, viewed 83 times
  • Hello Johan,

    The scope pics look good on first glance.
    I noticed that you are using quite an old DLL version. We recommend to use the latest one as there are quite some improvements over time.


    jmnl29 wrote:

    I also noticed that the trace frequency (as returned by the function that starts the tracing) seems to vary a lot: I've seen it be 8Mhz, 500kHz and 490kHz. Our core runs at 16Mhz, so from the wiki page you linked I would have expected it to be 8Mhz every time. Do you know why it would change this way, and if it could be an issue?
    That should of course not happen.
    Once you have passed the clock init of your startup code the trace clock should stay stable at usually 1/2 of the CPU clock speed.
    One reason might be that either the application is somehow altering the trace clock source during execution.


    jmnl29 wrote:

    I have tried enabling Batch Mode, but it doesn't seem to stop the dialog box from appearing - is there any way around this blocking error box?
    There is not option around it as it is an error. An error should be fixed as the trace stream is incomplete.

    How often do you get the unknown trace packet?
    To count this could you open the following link you your webbrowser during an active session?
    localhost:19080/trace.htm

    There you will see an unknown counter. Does the counter value stay at 1, or does it increase?

    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.