cancel
Showing results for 
Search instead for 
Did you mean: 

STLink V3-PWR and OpenOCD

DAlbe.3
Senior

Are there plans to add support for the STLink V3-PWR to OpenOCD?  At present, the USB device interface appears not to be supported (using the latest openocd snapshot).  STLink V3-MINIE works fine with openocd. 

For the V3-PWR, see the error (boldface added) below:

c:\openocd\bin>openocd -f interface/stlink.cfg -f target/stm32l4x.cfg -c "init" -c "reset halt"
Open On-Chip Debugger 0.12.0 (2023-07-12) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 500 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK V4J2B1S0 (API v3) VID:PID 0483:3757
Info : Target voltage: 3.287912
Error: init mode failed (unable to connect to the target)

5 REPLIES 5
Mike_ST
ST Employee

Hello,

>> Are there plans to add support for the STLink V3-PWR to OpenOCD? 

yes, it is in progress or already ready, I'm not sure of the current state, please check here: OpenOCD repo 

 

DAlbe.3
Senior

Thanks Mike, as you can see from my post, I'm running OpenOCD built July 12, 2023 and it does not work with the V3-PWR. 

A push in the repo from December 13, 2022 appears to have added support for the VID:PID of the V3-PWR but the comments still reference older firmware (not V4J2).  Antonio appears to still be working on the V3-PWR support with the most recent check-in on July 10, so perhaps it is a work in progress.

For now, I've put the V3-PWR back on the shelf. Even the ST software (CubeProgrammer, Power Monitor) are not production ready with the V3-PWR; it appears to have been released prematurely.  I appreciate ST's support for third party tools like OpenOCD and look forward to trying the V3-PWR again when the software has matured to the point of usability; it has the potential to be a very useful tool.

AntonioST
ST Employee

@DAlbe.3  support for STLINK-V3PWR has been added upstream on July 8th. No further work is required. The firmware V4J2 is supported.

It looks to me there is some communication problem between the STLINK and your STM32L4xx. Can you checked the connections?

Any improvement if you use interface/stlink-dap.cfg in the command-line, in place of interface/stlink.cfg?

 

I recently installed openocd 0.12.0 on Ubuntu 24.

I have an stlink-v3PWR, but it does not seem to work with openocd.

I'm sure I am missing something simple, but I've been bashing my head against a brick wall trying to break through.

$ openocd -f interface/stlink.cfg -f target/stm32f1x.cfg
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Error: read version failed

 

FWIW 1: There is a good 1 second delay between the "Info: clock speed line" and the "Error ...". It is as if openocd is trying to communicate with the STLink-V3PWR, but times out.

FWIW 2: I have installed STM32CubeProgrammer. It is able to communicate with the STLink and interact with a connected device (e.g. I can read the settings and FLASH memory from it). Cube reports the STLink firmware to be V4J2B1P4.

 

I want to be able to use openocd so that I can also use gnu-gdb.

 

Any tips/pointers to get this working would be much appreciated.

Hi gm10509 ,

You might want to check if you have the latest version of openocd. 0.12.0-3 works for me.

https://github.com/xpack-dev-tools/openocd-xpack/releases/