Forcing SWO frequency from command line

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

  • Forcing SWO frequency from command line

    I'm trying to run SWO viewer from automated tests to capture log output from target. For some reason CPU frequency measured by SWO tool is not always correct and causes SWO frequency to jump from 900kHz (correct) to 750kHz (incorrect).

    Using GUI version I can manually enter CPU frequency. However using command line options (both to GUI and CL version) I cannot. I've tried different combinations of -swofreq, -device, -cpufreq (only some of them, various orders) but they seem to be ignored at least to some point. For example setting SWO frequency does not work at all. Setting only CPU frequency leads to prompt for device, etc.

    I checked few version of J-Link tools (latest beta, latest stable and 5.12g) - all behaves exactly the same.
  • Hi,

    the SWO Viewer CL accepts both the command line argument "-swofreq" and "-cpufreq".
    Does this issue still persist?

    Best regards,
    Niklas
    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.
  • I'm using version 6.12e. The issues still persist.

    I attached screenshot (swo-cl.png) for example invocation of SWO Viewer. Even that I specified CPU Frequency as 14000 kHz (SWO frequency should be 900kHz), SWO frequency is reported as 750kHz. Few lines of data can be received but after restarting MCU nothing can be received.
    Running the same command can also lead to SWO Viewer reporting SWO frequency of 900kHz and then restaring MCU does not kill SWO output.

    What's more funny that order of parameters DOES matter, for example putting -cpufreq after -device gives results showed in attached screenshot (param-order.png).
    Images
    • swo-cl.png

      27.13 kB, 972×676, viewed 461 times
    • param-order.png

      31.84 kB, 1,413×707, viewed 381 times
  • Hi,

    you need to specify both -cpufreq and -swofreq in order to prevent the auto detection.
    Are using an eval board or custom hardware?


    Best regards,
    Niklas
    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.
  • It seems to work with following parameters: '-cpufreq -device -swofreq -itmmask 0x3'. Putting -device before -cpufreq caused UNSPECIFED device dialog.

    Now I ran into next problem. When starting and stopping (killing to be honest) SWO Viewer process rapidly (every few seconds) after few (like 4-10) iterations, SWO fails to start with message in attached screen shot (swo-buffer.png). I tried running SWOFlash with JLink before starting SWO Viewer but it didn't helped much.

    I'm using EFM32GG STK3700 board
    Images
    • swo-buffer.png

      4.97 kB, 471×165, viewed 350 times