I guess some people did manage to get V3 working according to this 
[thread](https://github.com/RadioOperator/CMSIS-DAP_for_STLINK-V3MINI/issues/1).
 

Although, I am quite surprised that I can't program anymore targets using the 
official V3SET. 
This one has only been updated using the CubeProgrammer. 

I will check using an oscilloscope and with very low speeds. 

On the V3 signals from the target,  would you say that the request for IDCODE 
is the part I've outlined in red ?

Thank you  


---

** [tickets:#373] ST-LINK V3SET fails to enter SWD **

**Status:** new
**Milestone:** 0.11.0
**Created:** Wed Dec 07, 2022 08:57 AM UTC by Tanguy Serrat
**Last Updated:** Wed Dec 07, 2022 04:53 PM UTC
**Owner:** nobody


Hi,

I am running into some issues to connect with a target using an ST-LINK V3SET. 

The setup is :
- Target: STM32F723IEK6
- Interface: SWD (dapdirect_swd / hla_swd)
- OS: 5.13.0-35-generic #40~20.04.1-Ubuntu 
- OpenOcd: Open On-Chip Debugger 0.12.0-rc2+dev-00989-g9501b263e 
(2022-12-06-23:45)
- libusb: libusb-1.0-0-dev/focal,now 2:1.0.23-2build1 amd64

The issue seems to be related to USB problems. 

The error is stlink_usb_error_check(): STLINK_JTAG_GET_IDCODE_ERROR  when 
running :

`openocd -d -f /usr/local/share/openocd/scripts/interface/stlink-dap.cfg -f 
/usr/local/share/openocd/scripts/target/stm32f7x.cfg`

Output is:
~~~
Info : 88 3 server.c:297 add_service(): Listening on port 6666 for tcl 
connections
Info : 89 3 server.c:297 add_service(): Listening on port 4444 for telnet 
connections
Debug: 90 3 command.c:155 script_debug(): command - init
Debug: 91 3 command.c:155 script_debug(): command - target init
Debug: 92 3 command.c:155 script_debug(): command - target names
Debug: 93 3 command.c:155 script_debug(): command - stm32f7x.cpu cget -event 
gdb-flash-erase-start
Debug: 94 3 command.c:155 script_debug(): command - stm32f7x.cpu configure 
-event gdb-flash-erase-start reset init
Debug: 95 3 command.c:155 script_debug(): command - stm32f7x.cpu cget -event 
gdb-flash-write-end
Debug: 96 3 command.c:155 script_debug(): command - stm32f7x.cpu configure 
-event gdb-flash-write-end reset halt
Debug: 97 3 command.c:155 script_debug(): command - stm32f7x.cpu cget -event 
gdb-attach
Debug: 98 3 command.c:155 script_debug(): command - stm32f7x.cpu configure 
-event gdb-attach halt 1000
Debug: 99 3 target.c:1657 handle_target_init_command(): Initializing targets...
Debug: 100 3 semihosting_common.c:109 semihosting_common_init():  
Debug: 101 3 stlink_usb.c:5081 stlink_dap_init(): stlink_dap_init()
Debug: 102 3 stlink_usb.c:3693 stlink_open(): stlink_open
Debug: 103 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x3744 serial: 
Debug: 104 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x3748 serial: 
Debug: 105 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x374b serial: 
Debug: 106 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x374d serial: 
Debug: 107 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x374e serial: 
Debug: 108 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x374f serial: 
Debug: 109 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x3752 serial: 
Debug: 110 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x3753 serial: 
Debug: 111 3 stlink_usb.c:3705 stlink_open(): transport: 4 vid: 0x0483 pid: 
0x3754 serial: 
Info : 112 7 stlink_usb.c:1434 stlink_usb_version(): STLINK V3J10M3B5S1 (API 
v3) VID:PID 0483:3753
Debug: 113 7 stlink_usb.c:1659 stlink_usb_exit_mode(): MODE: 0x01
Info : 114 7 stlink_usb.c:1470 stlink_usb_check_voltage(): Target voltage: 
3.347832
Debug: 115 7 stlink_usb.c:1727 stlink_usb_init_mode(): MODE: 0x01
Debug: 116 7 stlink_usb.c:3093 stlink_dump_speed_map(): Supported clock speeds 
are:
Debug: 117 7 stlink_usb.c:3096 stlink_dump_speed_map(): 24000 kHz
Debug: 118 7 stlink_usb.c:3096 stlink_dump_speed_map(): 8000 kHz
Debug: 119 7 stlink_usb.c:3096 stlink_dump_speed_map(): 3300 kHz
Debug: 120 7 stlink_usb.c:3096 stlink_dump_speed_map(): 1000 kHz
Debug: 121 7 stlink_usb.c:3096 stlink_dump_speed_map(): 200 kHz
Debug: 122 7 stlink_usb.c:3096 stlink_dump_speed_map(): 50 kHz
Debug: 123 7 stlink_usb.c:3096 stlink_dump_speed_map(): 5 kHz
Debug: 124 37 stlink_usb.c:1086 stlink_usb_error_check(): 
STLINK_JTAG_GET_IDCODE_ERROR
Error: 125 37 stlink_usb.c:3748 stlink_open(): init mode failed (unable to 
connect to the target)
Debug: 126 37 stlink_usb.c:1659 stlink_usb_exit_mode(): MODE: 0x01
Debug: 127 37 command.c:544 run_command(): Command 'init' failed with error 
code -4
User : 128 37 command.c:608 command_run_line(): 
Debug: 129 37 target.c:2199 target_free_all_working_areas_restore(): freeing 
all working areas
~~~

The usb device is enumerated in dmesg :
~~~
[171481.193449] usb 1-4.2: New USB device found, idVendor=0483, idProduct=3753, 
bcdDevice= 1.00
[171481.193461] usb 1-4.2: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[171481.193467] usb 1-4.2: Product: STLINK-V3
[171481.193471] usb 1-4.2: Manufacturer: STMicroelectronics
[171481.193475] usb 1-4.2: SerialNumber: 0019001C3656501420363341
[171481.198570] cdc_acm 1-4.2:1.1: ttyACM0: USB ACM device
[171481.199678] cdc_acm 1-4.2:1.4: ttyACM1: USB ACM device
~~~

Running stlink command `st-trace -v`:
~~~
Failed to parse flash type or unrecognized flash type
2022-12-07T09:08:55 DEBUG trace.c: show_help = false
2022-12-07T09:08:55 DEBUG trace.c: show_version = false
2022-12-07T09:08:55 DEBUG trace.c: logging_level = 100
2022-12-07T09:08:55 DEBUG trace.c: core_frequency = 0 Hz
2022-12-07T09:08:55 DEBUG trace.c: trace_frequency = 0 Hz
2022-12-07T09:08:55 DEBUG trace.c: reset_board = true
2022-12-07T09:08:55 DEBUG trace.c: force = false
2022-12-07T09:08:55 DEBUG trace.c: serial_number = any
2022-12-07T09:08:55 DEBUG common.c: *** looking up stlink version
2022-12-07T09:08:55 DEBUG common.c: st vid         = 0x0483 (expect 0x0483)
2022-12-07T09:08:55 DEBUG common.c: stlink pid     = 0x3753
2022-12-07T09:08:55 DEBUG common.c: stlink version = 0x3
2022-12-07T09:08:55 DEBUG common.c: jtag version   = 0xa
2022-12-07T09:08:55 DEBUG common.c: swim version   = 0x1
2022-12-07T09:08:55 DEBUG common.c: stlink current mode: mass
2022-12-07T09:08:55 DEBUG usb.c: JTAG/SWD freq set to 0
2022-12-07T09:08:55 DEBUG common.c: stlink current mode: mass
2022-12-07T09:08:55 DEBUG common.c: *** stlink_enter_swd_mode ***
2022-12-07T09:08:55 DEBUG usb.c: ENTER_SWD error (0x09)
Failed to enter SWD mode
2022-12-07T09:08:55 ERROR trace.c: Your stlink is not connected to a device
~~~

This seems to be somehow related to 
[#325](https://sourceforge.net/p/openocd/tickets/325/) 
[#308](https://sourceforge.net/p/openocd/tickets/308/) . 

Thank you for your help. 


---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to