Skip to main content
Visitor II
May 18, 2021
Solved

No ST-LINK detected! - STM32CubeIDE 1.6.1 - Win7 [SOLVED!] CubeProgrammer can see and program the board fine, CubeIDE won’t see the ST-LINK probe.

  • May 18, 2021
  • 8 replies
  • 99017 views

I’m preparing my computer for an upcoming STM32WB55 webinar.

For 3 days I have installed, uninstalled, system restore wipe, and re-install again the latest CubeIDE, CubeMX, CubeProgrammer, and ST-LINK “USB driver (STSW-LINK009) is for ST-LINKV2, ST-LINKV2-1 and STLINK-V3�?.

I created an example project; it builds fine, but at the time of debugging CubeIDE never sees the ST-LINK.

However I can take the resulting *.bin or *.elf from the project’s Debug folder and flash it with CubeProgrammer and run the example in the board (STM32WB5MM-DK in my case).

Also with CubeProgrammer I was able to upgrade the ST-LINK firmware in the STM32WB5MM-DK to the latest.

So although CubeProgrammer can see and program the board fine, CubeIDE won’t see the ST-LINK probe.

Please help.

    This topic has been closed for replies.
    Best answer by ELope.2

    Hey Laurent,

    It seems the culprit is libusb. After reading similar posts, I decided to try the latest libusb.

    I went out and downloaded the latest libusb 1.0.24 from /libusb-1.0/libusb-1.0.24/libusb-1.0.24.7z and copied the libusb-1.0.dll from the MinGW32\dll folder into the st-link-server folder "C:\Program Files (x86)\STMicroelectronics\stlink_server", kill the stlinkserver.exe process in task manager, and that did the trick!

    Now my STM32CubeIDE 1.6.1 can see the debug probes using either the ST-LINK (ST-LINK GDB server) or ST-LINK(OpenOCD) probe options.

    0693W00000AOrwQQAT.png 

    Laurent thank you for your pointing me in the right direction to find a solution.

    8 replies

    ST Employee
    May 18, 2021

    Hi,

    If you installed STM32CubeIde with Installer, you should have all the drivers installed and also stlink server application.

    If you only update STM32CubeIde from an old version, you won't have stlink server installed.

    Check that STLink server is installed and is running.

    To test it, If you go to the debug configuration, choose Openocd and choose the shared stlink and you can see the list of boards connected in the bottom.

    You can renamed them as you want.

    Rgds,

    Laurent

    Explorer
    November 24, 2024

    YES! You are the best answer!

    I also have the same issue, and found everywhere on the internet, but all can't help for me.

    NOT THE USB CABLE!

    NOT THE ST-LIINK DEVICE ISSUE!

    NOT THE BLACK PILL OR OTHER COLOR PILL BOARD!

    NOT THE STLINK DRIVER!

    IS: REINSTALL YOUR STLINK SERVER!!!!

    thank you sir!

    ELope.2Author
    Visitor II
    May 18, 2021

    Laurent, thank you for your reply.

    I tried your "Openocd and choose the shared stlink" suggestions, but cubeide stills detect no boards. See screenshots:

    Pressing REFRESH at the bottom of the window does not list the board.

    Cubeprogrammer sees the board just fine.

    Also I'm not upgrading; cubeide 1.6.1 is the first ever installed on this computer.

    Any other ideas?

    ST Employee
    May 18, 2021

    Thanks for the tests, seems ok on installation side.

    Don't forget to disconnect on CubeProgrammer before debugging with CubeIDe.

    Can you try on all other USB ports ?

    Is it connected via an usb hub ? try without if possible.

    Can you try another ST board to see if it is only this board type that fails ?

    Last test is to kill stlink server appli in win manager and start it manually in a cmd shell and copy the text you see.

    use verbose debug mode : stlinkserver.exe -d

    Rgds,

    Laurent

    ELope.2Author
    Visitor II
    May 19, 2021

    Hi Laurent,

    The boards are connected directly to my dell laptop, no USB hub is in use.

    I checked the dell website and my system have the latest chipset and usb drivers available.

    I tried plugging them in different ports but they still not detected.

    I tried 3 boards, stm32f3-dk, stm32f4-dk, and the stm32wb55; none were detected.

    I ran the stlinkserver.exe -d as you suggested and produced this output when I select Openocd, choose the shared stlink, and pressed the REFRESH button:

    C:\Program Files (x86)\STMicroelectronics\stlink_server>stlinkserver.exe -d
    	Debug: 1 0 : create_listening_sockets
    	Debug: 2 16 : Entering create_listening_sockets()
    	Debug: 3 16 : Creating the list of sockets to listen for ...
    	Debug: 4 31 : interface, tcp port : (null) , 7184
    	Info : 5 31 : default port : 7184
    	Debug: 6 31 : getaddrinfo successful. Enumerating the returned addresses ...
    	Debug: 7 31 : Processing Address 020d4f10 returned by getaddrinfo(1) : (null)
    	Debug: 8 31 : Created socket with handle = 132
    	Info : 9 47 : 127.0.0.1:7184
    	Debug: 10 47 : Socket bound successfully
    	Debug: 11 47 : Non Blocking Setting
    	Debug: 12 47 : alloc_init_sock_info : Allocated 003a28b8
    	Debug: 13 47 : Added socket to list of listening sockets
    	Debug: 14 47 : Freed the memory allocated for res by getaddrinfo
    	Debug: 15 47 : Exiting create_listening_sockets()
    	Debug: 16 62 : libusb_init, libusb version : 1.0.23.11397 : http://libusb.info
    	Debug: 17 62 : libusb_get_device_list entry
    	Debug: 18 78 : non_blocking_accept_main
    	Debug: 19 94 : Entering non_blocking_accept_main
    	Debug: 20 16358 : listening state : 1
    	Debug: 21 16361 : Entering process_accept_event() on socket 132, sock_info 003a28b8
    	Info : 22 16366 : 127.0.0.1:49560
    	Debug: 23 16369 : alloc_init_sock_info : Allocated 0281b618
    	Debug: 24 16372 : Added accepted socket 332 to list of sockets
    	Debug: 25 16376 : register-client : (dbg-config) returned value '1'
    	Stlk : 26 16381 : usb-refresh : command received from (dbg-config)
    	Debug: 27 16419 : count stlink_usb_list :0
    	Debug: 28 16422 : Refresh: List USB :0
    	Stlk : 29 16423 : usb-refresh : (dbg-config) returned value '1 0'
    	Debug: 30 16428 : get-nb-stlink : command received from (dbg-config)
    	Stlk : 31 16432 : get-nb-stlink: (dbg-config) : returned value '1 0'
    	Error: 32 16437 : ERROR: recv failed. error = 10054
    	Debug: 33 16439 : not ask to exit() because 0
    	Debug: 34 16443 : List of SockInfo 00418004
    	Debug: 35 16455 : Delete SockInfo next 00418004, list previous 003a28b8
    	Debug: 36 16460 : Freed sock_info at 0281b618
    	Debug: 37 37136 : listening state : 1
    	Debug: 38 37136 : Entering process_accept_event() on socket 132, sock_info 003a28b8
    	Info : 39 37152 : 127.0.0.1:49561
    	Debug: 40 37152 : alloc_init_sock_info : Allocated 0281b618
    	Debug: 41 37168 : Added accepted socket 232 to list of sockets
    	Debug: 42 37168 : register-client : (dbg-config) returned value '1'
    	Stlk : 43 37168 : usb-refresh : command received from (dbg-config)
    	Debug: 44 37214 : count stlink_usb_list :0
    	Debug: 45 37214 : Refresh: List USB :0
    	Stlk : 46 37214 : usb-refresh : (dbg-config) returned value '1 0'
    	Debug: 47 37214 : get-nb-stlink : command received from (dbg-config)
    	Stlk : 48 37214 : get-nb-stlink: (dbg-config) : returned value '1 0'
    	Error: 49 37230 : ERROR: recv failed. error = 10054
    	Debug: 50 37230 : not ask to exit() because 0
    	Debug: 51 37230 : List of SockInfo 00418004
    	Debug: 52 37230 : Delete SockInfo next 00418004, list previous 003a28b8
    	Debug: 53 37246 : Freed sock_info at 0281b618
    	Debug: 54 67260 : No connections/data in the last 30 seconds.
    	Debug: 55 97264 : No connections/data in the last 30 seconds.
    	Debug: 56 127278 : No connections/data in the last 30 seconds.
    	Debug: 57 157286 : No connections/data in the last 30 seconds.

    There is no log activity when I plug/unplug the devices; it is like the program is not aware of the devices enumerating events.

    : (

    ELope.2AuthorAnswer
    Visitor II
    May 19, 2021

    Hey Laurent,

    It seems the culprit is libusb. After reading similar posts, I decided to try the latest libusb.

    I went out and downloaded the latest libusb 1.0.24 from /libusb-1.0/libusb-1.0.24/libusb-1.0.24.7z and copied the libusb-1.0.dll from the MinGW32\dll folder into the st-link-server folder "C:\Program Files (x86)\STMicroelectronics\stlink_server", kill the stlinkserver.exe process in task manager, and that did the trick!

    Now my STM32CubeIDE 1.6.1 can see the debug probes using either the ST-LINK (ST-LINK GDB server) or ST-LINK(OpenOCD) probe options.

    0693W00000AOrwQQAT.png 

    Laurent thank you for your pointing me in the right direction to find a solution.

    ST Employee
    May 19, 2021

    Hello,

    Glad you found the issue.

    It was the last test I would have hinted but honestly I didn't think it would solve the issue as libusb team found some regressions in this latest version (regression on Linux) and will issue 1.0.25 version to fix it by end of June.

    Visitor II
    June 28, 2021

    Hi

    I am facing the same issue in STMcubeIDE 1.6.1 and I tried all of the above method but nothing works for me. I am a beginner and this is my time to start working on any microcontroller. I am trying to solve this issue since two days but still can't do it. Please Guide me

    ST Employee
    June 28, 2021

    Hello SShah.15,

    You are also on Windows 7 64 bits ?

    Or another Windows OS version ?

    Is STM32CubeProgrammer able to see the board and so the STLink ?

    What board is it ? An ST board ?

    Rgds,

    Laurent

    Visitor II
    June 28, 2021

    No I'm using window-10 64 bits​. Also I am working on STM32F103RBT6. I can't see the board on STM32cubeprogrammer.

    Visitor II
    January 6, 2022

    Hello everyone. Finally I have got a solution. Hope this will be helpful for you as well..

    I have also encountered the same No st-link detected issue. I have tried installing older versions of cube ide, updating drivers, updating firmware etc. but didn't succeed by anything.

    Then I have replaced the libusb-1.0.dll in the stlink server directory. The first time it didn't work. But I kept trying different versions of the libusb-1.0.dll file and finally the issue got solved after installing the latest version of the dll file..

    Follow the instructions mentioned by Elope 2 above in this forum.

    Here is the link for the latest version of the dll files as of 6th Jan 2022.: https://webwerks.dl.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.24/libusb-1.0.24.7z

    Depending on your computer settings the required file may differ. If you are not sure about how to decide the correct file, just keep trying every dll file one by one.

    I found this working solution after doing tons of searching and trying. So

    I hope that this will be helpful for someone. There is always a solution for anything. Just don't give up and keep trying again and again.