ST-Link v2 device not found

Sysprogs forums Forums VisualGDB ST-Link v2 device not found

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #878
    rraab
    Participant

    I’m getting a “device not found” error using OpenOCD with ST-Link v2 for an STM32F103RBT6. I have the necessary USB drivers installed, and STM’s ST-Link utility connects to the board without issue. I see with “Test selected OpenOCD Settings” that it cannot find any hardware with Vendor ID of 0483 and Device ID of 3748. The driver utility and Windows Device Manager show the ST-Link has the right Vendor ID but has a Device ID of 374B (Note the hex “B” rather than “8”).

    Are there any settings I can change to have OpenOCD look for the right Device ID?

    (P.S. I’ve tried the Texane debug option and that doesn’t work either.)

    #3316
    support
    Keymaster

    Hi,

    Looks like 374b is mentioned in the stlink-v2-1.cfg configuration file in the OpenOCD directory. You can edit the %LOCALAPPDATA%VisualGDBEmbeddedDebugPackagescom.sysprogs.arm.openocdQuickSetupinterfaces.xml file to make VisualGDB recognize it automatically:

    	
    stlink-v2-1
    ST-Link v2
    interface/stlink-v2-1.cfg


    0483
    374B


    true
    NotSupported
    com.sysprogs.libusb.mini

    #3317
    rraab
    Participant

    That allowed OpenOCD to find the ST-Link, thank you. However I’m now encountering the “OpenOCD error with ST-Link V2” reported by tekati. I’ll be watching that thread for any resolution.

    #3318
    tekati
    Participant

    I finally got mine to work. This is basically what I had to do or why it did not work to start with.

    First off download and install the STLink V2 Drivers and Utility.
    This is the link for STSW-LINK003 which is the DRIVERS file from ST
    http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/driver/st-link_v2_usbdriver.zip
    This is the link for STSW-LINK004 which is the UTILITY file from ST
    http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/utility/stsw-link004.zip

    Now I uninstalled all my current drivers and then installed both of these files and drivers.

    Then I plugged my board back in.

    Once the drivers installed themselves I went back to Visual Studio and opened up a previous example so I could get to the settings.
    Project > VisualGDB Project Properties > Debug settings. Debug Method: OpenOCD. View Mode: Quick Setup. The device type should be autodetected as STM32F4xxx. Programming Interface: ST-Link v2. Before Debugging: Load the program into FLASH/RAM. Then I clicked on the Test selected OpenOCD settings. Now when it asked me to install the WinUSB drivers I actually just hit cancel. I did not try to install them to see if that worked too but since it worked without them and I fought to get that far I just left it alone and OK’ed out. Have not had a problem since.

    Hope this helps others and if you have questions ask and I will try my best to answer them. Not sure why no one answered this before and for a product that I am expected to purchase I was hoping for better tech support. Now I have 24 days to evaluate the program which should be fine but what else am I going to have issues with and not get any support 🙁

    #3315
    rraab
    Participant

    I uninstalled all my drivers and reinstalled the ones you linked. When I plugged the STM board back in, Windows failed to install/find the right drivers. However OpenOCD found the ST-Link device. When it prompted for the WinUSB driver, I clicked “no” and it failed with the same error as before. If I click “OK” and install the winusb it still fails same as always. Tried using the driver tool to install the libusb-winusb driver over it, still fails.

    The problem may be that the STM32 F103RBT6 I’m using has ST-Link v2.1, perhaps OpenOCD can’t handle that newer protocol. I can’t find any documentation of which ST-Link version the F103RB uses, so I’m not sure. But either way it’s killing me not to be able to debug my program.

    #3310
    support
    Keymaster

    Hi,

    Sorry, we tried reproducing it on our hardware (ST-Link v1 and v2) and could not get the problem. It looks like OpenOCD may not fully support st-link v2.1 at this point. Does the Texane/STLink tool work for your hardware?

    #3311
    G40
    Participant

    Hello Chaps,

    OpenOCD 0.8 does support STLink V2.1. Not sure if this has yet made it into the VGDB builds?

    #3312
    G40
    Participant

    @rraab wrote:

    right Vendor ID but has a Device ID of 374B

    Is this one of the ST Nucleo boards with mbed support etc? If so try ditching the ST drivers etc. completely and use Zadig to install a WinUSB driver for the board.

    Good luck.

    #3313
    support
    Keymaster

    Hi,

    Our build is using the source code from the official 0.8.0 release with the only modification being the Windows 8.1 fix (the package includes a patch file with all our changes to the source).
    Could you please confirm that the original OpenOCD works with your hardware but our one does not given the same command-line arguments and driver?

    #3314
    rraab
    Participant

    I ditched the ST drivers and went with the libusb-winusb option in the driver manager. I also changed the “stlink-v2.cfg” that was auto-set to “stlink-v2-1.cfg”, to reflect the ST-Link 2.1 that my board probably uses, and now everything works.

    Thank you everyone for your help.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.