cancel
Showing results for 
Search instead for 
Did you mean: 

OpenOCD cannot open connection to STM32L4 board (STEVAL STWINCSV1)

RLyma.1
Associate II

I have a STEVAL STWINCSV1 board with an STM32L4R9 chip connected to my computer via USB. I am trying to use OpenOCD to flash a new image. I am using the command `openocd -d -f board/stm32l4discovery.cfg` to try to open a connection to the board. Here are the contents of the cfg file

# Explicitly for the STM32L476 discovery board:
# http://www.st.com/web/en/catalog/tools/PF261635
# but perfectly functional for any other STM32L4 board connected via
# an stlink-v2-1 interface.
# This is for STM32L4 boards that are connected via stlink-v2-1.
 
source [find interface/stlink-v2-1.cfg]
 
transport select hla_swd
 
source [find target/stm32l4x.cfg]
 
reset_config srst_only

When I plug in the board via USB and check the output of dmesg, here is what I get (I plugged the board in multiple times):

[15316.981696] usb 1-1.3: new full-speed USB device number 7 using xhci_hcd
[15317.119120] usb 1-1.3: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[15317.119121] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[15317.119122] usb 1-1.3: Product: STM32 Virtual ComPort in FS Mode
[15317.119123] usb 1-1.3: Manufacturer: STMicroelectronics
[15317.119123] usb 1-1.3: SerialNumber: FFFFFFFEFFFF
[15317.169176] usbcore: registered new interface driver cdc_acm
[15726.366247] usb 1-1.3: USB disconnect, device number 7
[15733.238286] usb 1-1.3: new full-speed USB device number 8 using xhci_hcd
[15733.363181] usb 1-1.3: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[15733.363182] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[15733.363183] usb 1-1.3: Product: STM32 Virtual ComPort in FS Mode
[15733.363184] usb 1-1.3: Manufacturer: STMicroelectronics
[15733.363184] usb 1-1.3: SerialNumber: FFFFFFFEFFFF
[15822.875489] usb 1-1.3: USB disconnect, device number 8
[15861.278256] usb 1-3.4: new full-speed USB device number 9 using xhci_hcd
[15861.400511] usb 1-3.4: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[15861.400512] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[15861.400513] usb 1-3.4: Product: STM32 Virtual ComPort in FS Mode
[15861.400514] usb 1-3.4: Manufacturer: STMicroelectronics
[15861.400514] usb 1-3.4: SerialNumber: FFFFFFFEFFFF
[16196.113834] usb 1-3.4: USB disconnect, device number 9
[16251.868195] usb 1-1.3: new full-speed USB device number 10 using xhci_hcd
[16252.006377] usb 1-1.3: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[16252.006378] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16252.006379] usb 1-1.3: Product: STM32 Virtual ComPort in FS Mode
[16252.006380] usb 1-1.3: Manufacturer: STMicroelectronics
[16252.006380] usb 1-1.3: SerialNumber: FFFFFFFEFFFF

When I run `openocd -d -f board/stm32l4discovery.cfg`, here is the output (pastebinned since it was too long): https://pastebin.com/biVLuf7U

Does anyone know what's up with this?

1 ACCEPTED SOLUTION

Accepted Solutions
RLyma.1
Associate II

I figured this out. Two things: first, this eval board doesn't have an st-link interface over its usb connection, so I needed to use the st-link/v3 programmer they sent with it. And second: I needed to build the latest version of openocd from source which has support for st-link/v3.

View solution in original post

1 REPLY 1
RLyma.1
Associate II

I figured this out. Two things: first, this eval board doesn't have an st-link interface over its usb connection, so I needed to use the st-link/v3 programmer they sent with it. And second: I needed to build the latest version of openocd from source which has support for st-link/v3.