New J-link gives internal error on SWO speed

  • New J-link gives internal error on SWO speed

    I just received a new J-Link module (they're in short supply here). I have updated to the latest driver (2.6.8.2). When I connect up to the STM32F103 (using the IAR IDE), it pops up a warning message, saying:
    J-Link V4.501 Internal Error
    API Error: Debugger selected a SWO Speed of 6000kHz.
    J-Link is capable of speeds 60000KHz / n, n min. = 8
    Closest speeds are 7500kHz and 3750000kHz. Max. permitted deviation is 3%
    SWO can not be used with the currently selected speed
    Disregarding the 3 extra zeros on the 2nd to last line, with some experimentation of setting the desired SWO speed, it appears the J-Link has values of n=8, 16,24,32,40... This is a bit odd, because according to the specs, the maximum SWO speed is 6 MHz, a speed that the J-Link totally skips over in practice.

    I don't know what divisors the STM32 chip uses, it doesn't seem to be as regular as the J-link (6000 KHz, 3529, 2400, 1818, 1500 KHz - the best I can come up with is 60MHz/n, where n=(8+2), (16+1), (24+1), (32+1), 40).
    At 1500 KHz, both sides seem to be happy (the current design doesn't allow for SWO output anyway, but the pop-up message was annoying, and we do plan to allow that in future designs).

    Questions: At 1500 KHz, will that noticeably slow down printf output? Does this affect SWC? And why is the new J-link behaving differently than our other units?
  • Hi,

    I have updated to the latest driver (2.6.8.2).

    What driver are you referring to here?
    The J-Link software itself is at V4.62, not V2.6x.

    SWO Speeds:
    You can check the SWO speeds which are supported by the connected J-Link model, via J-Link Commander.
    According to your description, you are using a J-Link with hardware version 9 which supports SWO speeds of:
    60000 kHz / n where n >= 8. So 6 MHz is indeed supported...


    What did you selected in EWARM, a fixed SWO speed or auto-detection?
    Note that the max. SWO speed that can be used depends on the CPU speed, since the target needs to use the
    same speed for sending the SWO data as J-Link uses for sampling.
    This is why the CPU speed needs to be known by the IDE, so it can calculate the highest speed that is supported by both sides automatically.
    The target usually supports SWO speeds of CPUClock / n where n >= 1.

    Example:
    STM32F2xxx target running at 120 MHz.
    Highest possible SWO speed supported by both sides: 7.5 MHz
    n of CPU (configured by IDE): 16
    n of J-Link (configured by IDE): 8

    6 MHz would also be possible:
    n of CPU (configured by IDE): 20
    n of J-Link (configured by IDE): 10

    Hope it helps.


    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.