Skip to main content
Visitor II
July 5, 2020
Question

STLINK-V3SET cannot communicate with target over SWIM (or doesn't work at all?) with STVD/STVP

  • July 5, 2020
  • 11 replies
  • 7277 views

I have an STLINK-V3SET with MB140B adapter.

I am trying to program an STM8S003F3P (minimum evaluation board) over SWIM

I've installed the en.stsw-link009 driver on my Windows10

I've put jumpers on JP4 and JP6

My code is specific for STM8S and compiled and builds fine.

When I use STVD or STVP to program the code on the chip, when pressing start I get the following:

Cannot communicate with the device, check the SWIM connection...

I tested continuity, everything is fine.

I actually think the STLINK-V3SET isn't working right!

When doing ST-LINK Upgrade, on Device Connect, I get: The content of the ST-Link is corrupt

I don't know if the ST-LINK Upgrade is just not compatible with the V3SET or my LINK is really broken...

How to start debugging my problem?

Thanks

    This topic has been closed for replies.

    11 replies

    ST Employee
    July 6, 2020

    Hello,

    JP3 on MB1440 is also required to be closed for SWIM to function. There is an issue in the User Manual UM2448 around that, I'm sorry for that. If you have it opened, it might explain your issue.

    Regarding ST-LinkUpgrade.exe, the version delivered with STVD and STVP toolset is not accurate; the reference for an up-to-date STLink is STSW-LINK007 on st.com:

    https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link007.html

    Note however that there is no SWIM specific changes in recent versions, I don't think an update is really mandatory to fix your issue.

    TKole.1Author
    Visitor II
    July 6, 2020

    JP3 was closed the whole time...

    Are you saying I need to change my driver from en.stsw-link009 to STSW-LINK007?

    ST Employee
    July 7, 2020

    No, STSW-LINK009 is OK as regards the driver (identification of any St-Link by Windows). STSW-LINK007 is only an update of STLinkUpgrade.exe compared to the version provided by STVD+STVP which generates the "ST-Link is corrupt" message. Do you still get this message with the STLinkUpgrade version from st.com (STSW-LINK007) ?

    I may also suggest to check the version of following dlls:

    • stvp/STLinkUSBDriver.dll and stvd/swim/STLinkUSBDriver.dll: should be v5.0.3 (installed by STToolset; if you want you might try to update with the 32bits version of this dll from STSW-LINK007)
    • stvd/swim/stm_swim: should be v1.6.13

    With this configuration (and JP3,4,6 closed) I've been able to connect with STVD on the target of a STM8S-DISCO. It's difficult to understand what may happen on your side

    Explorer
    September 17, 2020

    Ok, good so far... I've got same issue on Both of our STLINK-V3SET units: JP3,4&6 on.

    Matching version of DLLs as above.

    Here's what's different: I see the Com LED flicker on Start Debugging - as I'd expect, but my o'scope shows no change on DIO of SWIM.

    So, no wonder I get "error 30006 : comm init error : chip does not answer".

    None of the TX pins on MB1440B show any change - SDA, CAN, etc. (just curious)

    I see on MB1441B main board: JP1 & 2 on, JP3 off - is this ok?

    What am I missing? Thanks <<<)))

    ST Employee
    September 17, 2020

    Hello,

    MB1441B.JP2 On is OK, this allows to provide 5V to the MB1440 board. Then MB1440.JP3 must also be On (mistake in the documentation as explained above), so your configuration seems OK. May you please check with the oscilloscope that 5V is really present on MB1440.JP3 ? And that the target voltage is also provided to MB1440.CN4.VCC ?

    In this situation even in case of issue on the STM8 side, you should at least see the SWIM init sequence out of MB1440.CN4.DIO (starting with 4x2ms pulses then 4x1ms pulses)

    Explorer
    September 17, 2020
    I first posted this in the thread:
    Hi, Thanks for fast reply. +5 @ 1440 JP3 = yes, @ CN4 (or CN5) VCC = no.
    CN4 VCC isn't connected on my target - I supply +3.3.
    I could see the 5 vs 3.3 on my not answering, but I'm not being "asked"
    (I'll be changing to +5 - board builder grabbed wrong part)
    Still no DIO activity (thanks for the pulse train info).
    Does DIO need the target or a pullup resistor?
    O'scope set at 1V & 250mS /divs (Tektronix TDS2002 DSO).
    Which pin on which interconnector should I see DIO?
    Poking around, I found CN1 p10 issues a short spike at "Start Debugging"
    Haven't checked all interconnect lines (hoping I wouldn't have to).
    Thanks again, Ii feels like I'm making progress <<<)))
    Explorer
    September 17, 2020

    Hi, Thanks for fast reply. +5 @ 1440 JP3 = yes, @ CN4 (or CN5) VCC = no.

    CN4 VCC isn't connected on my target - I supply +3.3.

    I could see the 5 vs 3.3 on my not answering, but I'm not being "asked"

    (I'll be changing to +5 - board builder grabbed wrong part)

    Still no DIO activity (thanks for the pulse train info).

    Does DIO need the target or a pullup resistor?

    O'scope set at 1V & 250mS /divs (Tektronix TDS2002 DSO).

    Which pin on which interconnector should I see DIO?

    Poking around, I found CN1 p10 issues a short spike at "Start Debugging"

    Haven't checked all interconnect lines (hoping I wouldn't have to).

    Thanks again, Ii feels like I'm making progress <<<)))

    Explorer
    September 17, 2020

    Just answered one question: it Does need a pullup!

    Target was just pulling to ~.5V, add a 10k PU and start signal is well seen.

    Issue may now be 5V vs 3.3 @ target. Sound about right?

    What's best PU value @ 5V? TNX <<<)))

    Explorer
    September 17, 2020

    The 10k PU made it change from :chip does not answer" to "st-link connection error"

    It is also not an immediate failure, I'd estimate a 6 second timeout to error message.

    Time to change that 3.3 for a 5 is NOW. TNX <<<)))

    ST Employee
    September 17, 2020

    There is a 680 ohms pull-up to VCC on the tool side on MB1440. This pull-up is required by the SWIM protocol and that's one reason why MB1440.CN4.VCC should be provided with Vtarget. So I would say that no additional external pull-up is required. All SWIM signals are accessible on MB1440.CN4, at interconnection level they are shared with JTDI and JTDO but I suppose you did not simultaneously connect something else to the ST-Link ? [And that's why you could see things on STDC14, it's normal]

    Perhaps should you try to probe the DIO pin on the tool side, while not connecting it to the target (but providing VCC), in order to ensure that the tool is correctly doing the init sequence in this case ? If yes, you'll then need to understand why the target could pull the pin low, did you connect also NRST ? [this should ensure, that during the init sequence, the STM8 pins are in input state]

    Explorer
    September 17, 2020
    Ok, this explains MUCH: I'm supposed to supply VCC @ CN4.
    It also allows 3.3V or 5V signaling to work.
    I misunderstood the VCC @ CN4 description and didn't want them in conflict.
    Boss wants me on something else now, I'll add the V+ -> VCC at target tomorrow.
    THANKS for putting up with me.
    I'm new to ST, but been building & coding assembler since Z-80 (~1977). <<<)))
    Explorer
    September 17, 2020

    Still something wrong. 5V to chip, 10k PU on DIO.

    After dis / reconnect USB:

    Reset line is 4.9V with a narrow pulse to ground every ~1 second

    DIO is 2.8V solid.

    At "Start Debugging" reset stays high, DIO pulses.

    Almost immediate "error 30006 :comm init error: chip does not answer"

    Reset is held ~.1V, DIO is 2.8V solid.

    The Com LED is both Green & Red.

    This remains until dis / reconnect USB.

    Any tries until USB reset gets ""30200: st-link connection error"

    Pin 42: D1 / SWIM is getting pulse train.

    Just tried without 10k PU.

    Same "not answer", but com LED returns to solid red, reset returns to high w/pulse and DIO is .9V

    Just got your response, I'll do that next.

    Without me using PU, DIO is at .9V.

    OOH, Am I supposed to supply VCC to CN4?

    That would explain MUCH.

    And allow for 5V or 3.3V targets.

    Visitor II
    November 18, 2020

    0693W000005BtQkQAK.pngHello. and me have problem not working st-linkv3set for stm8. Mb1440B swim=on  jp4=1 & jp6=1 and jp3=1 up to 5v. Please help me i can't figure it out. i worked all-time with avrdragon and no have problems with use anytime. Usability and easy work. Stlink very hard work and many problem for me. And software no usability. Maybe lessons or movies helpful?