2021-05-17 10:11 PM
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.
Solved! Go to Solution.
2021-05-18 11:42 PM
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.
Laurent thank you for your pointing me in the right direction to find a solution.
2021-05-18 12:00 AM
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
2021-05-18 01:48 AM
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?
2021-05-18 01:59 AM
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
2021-05-18 10:54 PM
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.
: (
2021-05-18 11:42 PM
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.
Laurent thank you for your pointing me in the right direction to find a solution.
2021-05-19 01:41 AM
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.
2021-06-28 02:10 AM
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
2021-06-28 03:29 AM
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
2021-06-28 04:25 AM
No I'm using window-10 64 bits. Also I am working on STM32F103RBT6. I can't see the board on STM32cubeprogrammer.