[SOLVED] Demultiplexing and timestamping SWO trace output

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

  • [SOLVED] Demultiplexing and timestamping SWO trace output

    We are working on a project which uses SWO for relatively fine-grained real-time tracing. The system includes multiple ITM channels allocated to different tasks and includes multiple capture devices monitoring a distributed system.

    This output is currently captured by JLinkSWOViewerCL for further processing, display and filtering. Unfortunately, this does not result in sufficient information to collate the information into a chronological and demultiplexed sequence of events.

    Is there any way of capturing SWO data through J-Link devices using public software or the SDK in a way tags the following information:
    1. The specific ITM channel which generated the trace packet.
    2. An approximate timestamp of the trace packet.

    Thank you in advance for your support.

    Regards,
    Johan
  • Hi Johan,

    Thank you for your inquiry.
    If you are planning to write your own SWO analysis tool we recommend to use the J-Link SDK. There you can grab the raw output from the target and process it in your tool then.

    segger.com/products/debug-prob…nk/technology/j-link-sdk/

    Regarding 1:
    According to Arm architecture documentation the stimulus Port Number (0-31) is automatically added to the raw trace stream.

    Regarding 2:
    Most target devices support local timestamps that can be send with via SWO.
    They are dependent on the events that are configurable e.g. periodic PC sample packets. The smallest sample interval is 64 CPU cycles.
    So the most accurate periodic timestamp that you can get via SWO is every 64 CPU cycles.
    These can be e.g. configured by using the J-Link SDK.

    To best of my knowledge timestamps are not generated if you simply write to a stimulus port.

    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.