Debug failing NUCLEO-L152RE
Hi,
Same behavior, the problem in my case was libusb library. (I have this problem only on Win8.1, working well with Win7 and Win 10 - all x64.)
This is a generic error and not very helpful. If I remember well even if you don’t connect you board/ST-LINK probe you get exactly the same error.
Is good that you can program the device using the STM32 ST-LINK Utility. This means that jumpers on the board are correctly configured. Anyway you can check again just to be sure - check the board User Guide.
If you have some application (ST default app), check the Run/Stop from ST-LINK Utility. If I remember well should be under Target>MCU Core.
Regarding to your problem, I think first you have to get more information’s - enable debug level 3 for OpenOCD.
System Workbench use OpenOCD to connect to hardware debug probe on Nucleo board. OpenOCD send commands over USB to debug probe (in this case ST LINK v2 or v2.1).
GDB will connect to OpenOCD. When a breakpoint/command (e.g Debug) is issued on Eclipse IDE this is transferred to GDB.
BEFORE to do any debug on OpenOCD, be sure to create your project and use the correct OpenOCD script for your Nucleo board as it is describe in next documentation.
This will ensure that you have the correct configuration of GDB and OpenOCD
Creating a new project:
http://www.openstm32.org/Creating+a+new+project?structure=Documentation
Importing a STCubeMX generated project:
http://www.openstm32.org/Importing+a+STCubeMX+generated+project?structure=Documentation
You will find how to enable debug on OpenOCD in this thread Unable to debug with ST-LinkV2-1:
http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=722
Get the log file and very important things are:
1) VID and PID of your ST LINK (0x0483 0x3748 or 0x374B in case of v2.1 - don’t use an OpenOCD script for v2.1 if you have 2.0 - will not work
2) return of the function stlink_usb_open() (see debug file)