Skip to main content
Visitor II
January 21, 2011
Question

STM8L-Discovery Debugging

  • January 21, 2011
  • 10 replies
  • 3686 views
Posted on January 21, 2011 at 08:27

Hello,

I use the ST Visual Develop IDE together with the Cosmic Compiler and the STM8L-Discovery.

Everything seems to work fine, besides the debug function.

When I try to start debugging I get the following error message:

''Connection error (usb://usb): swim error [30200]: st-link connection error''

I found discussions of Linux users about this topic, but I use Windows...

Any idea how I get this to work?

Thanks in advance.
    This topic has been closed for replies.

    10 replies

    ST Employee
    January 21, 2011
    Posted on January 21, 2011 at 09:06

    Hello,

    Please check if below topic can help you solving your issue or comeback to the forum.

    [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM8LDiscovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM8LDiscovery/Problems debugging with STVD&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000B276AC6C9F9B7A43ACF58B3CEB87C40C&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM8LDiscovery/AllItems.aspx&currentviews=188]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM8LDiscovery/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM8LDiscovery%2fProblems%20debugging%20with%20STVD&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000B276AC6C9F9B7A43ACF58B3CEB87C40C&TopicsView=https%3A%2F%2Fmy%2Est%2Ecom%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM8LDiscovery%2FAllItems%2Easpx&currentviews=188

    Thanks.

    stm8Author
    Visitor II
    January 21, 2011
    Posted on January 21, 2011 at 09:30

    Hello,

    I selected the project and debug settings according to the quickstart manual.

    I don't use a usb-hub, the device is listed in the device manager as a storage.

    I didn't try it with another pc, but tried another stm8l-discovery, that doesn't work either...

    Any other posibilities to try?

    Thanks

    ST Employee
    January 21, 2011
    Posted on January 21, 2011 at 10:50

    Hello,

    It seems that your problem is related to the ST-link driver which is perhaps not properly installed.

    You have to check in your Control Panel/System/Device Manager if ST-link is detected once the device is plugged in your USB port (a sound is emitted at device plug-in). If so, try to remove it by pressing DEL key and confirm, then disconnect and re-plug the STM8L-Discovery, this forces the driver to be re-installed. Check if this operation has solved the issue.

    Other thing is to try connecting your device on another USB port and wait for the system to detect again the device.

    Have you another USB cable to try (minimum cable length is recommended)?

    Other way to check the communication is to use ST Visual Programmer toolset (delivered with ST toolset package) and available by windows menu Start/All Programs/ST Toolset/Development Tools/ST Visual Programmer. Once application opened, select Hardware as ST-LINK, Programming Mode as SWIM and Device as STM8L152C6. Try now to read the device with the Read icon (green) or by the Read menu then Current Tab. If programmer is able to read the device, try to erase it by first filling FFh data in the whole memory range, right click on the memory buffer, Fill area..., enter FF value then confirm. Now press Program icon (Red); This will program the device memory with FFh data.

    In this case, under stvd when using the debug mode, the system will be forced to load and write the program again into the device. This is a way to re-initialize the communication properly.

    Please check these points and let us know.

    Thanks.

    stm8Author
    Visitor II
    January 24, 2011
    Posted on January 24, 2011 at 08:35

    It's annoying...

    After unsuccessfully trying all your suggestions I decided to use a different PC.

    Now I'm able to read and write with the ST Visual Programmer.

    Unfortunately it still isn't possible to debug with the ST Visual Develop.

    But now I get a different error message:

    Connection error (usb://usb): swim error [30004]: comm timeout

    Note: I still don't use a usb hub and allready tried usb cables of different length.

    ST Employee
    January 24, 2011
    Posted on January 24, 2011 at 09:54

    Are you sure to have the right settings in your STVD, menu Debug instrument/Target Settings/ target to choose is Swim ST-Link and target Port Selection is usb://usb?

    Or did you try with another STM8L-Discovery? ;)

    In any case, have you ever seen this board working? If no, I advise to get closer of your hardware distributor and to try getting a board exchange and see...

    Regards.

    Visitor II
    July 26, 2011
    Posted on July 26, 2011 at 13:43

    I had the similar problem, particulary ''SWIM error [30200]: ST-Link connection error'' while trying to start debugging in IAR. I found that the problem was in virtual DVD-RW drive created with Alcohol 120%. Its letter stood prior to ST-Link and debugger stumble on it while examining drives. Deleting virtual disk solved the problem.

    Visitor II
    August 1, 2011
    Posted on August 01, 2011 at 12:23

    Hi, I've detected that with the original version of the st toolset the ST-Link swin works fine, but once I upgrade the toolset to the patch 1 or patch 2, the same error appear.

    If I uninstall all and reinstal the toolset without patch, it works again.

    Any idea of how to make it work with the patchs?.

    Regars

    Oscar

    Visitor II
    August 24, 2011
    Posted on August 24, 2011 at 14:06

    Same problem after upgrading from STVD 4.2.0 to 4.2.1 , also did upgraded with patches 1 & 2 but problem stayed.. after removing 4.2.1(reboot etc et)  and installing the older 4.2.0 back I was back in business... anyone who can pinpoint the problem with cure

    Visitor II
    December 16, 2011
    Posted on December 16, 2011 at 07:49

    i had the same situation today. and fix it by follow steps.

    1.Execute ST Visual Programmer and execute read cmd. to check the connection.

    2.Be administrator to execute the STVD program and download again.

    best regards

    Aska

    Visitor II
    January 3, 2012
    Posted on January 03, 2012 at 21:46

    Hi, after playing with the toolset dll, i've found out the following:  first i took a copy of the stvp folder. installed 4.3 and replaces all stlinkusbdriver.dll (v4.2.2.0) with the old version (v4.0.1.2). Stangly the new V4.2.2.0 is only 64Kb while the old one is 380Kb in size. So it is possible that some other conflics arrive with this change...