Page 1 of 1

Unable to connect to ST-Link/V2

Posted: Thu Dec 06, 2018 3:20 pm
by frot
After upgrading TrueSTUDIO I can no longer connect to the target using my ST-Link/V2 device.

Working version TrueSTUDIO v9.0.1
Not working v9.1.0 or v9.2.0

The problem seems to be the GDB-server.
When using the version included with 9.0.1 I get the following result:
Atollic TrueSTUDIO gdbserver for ST-Link. Version 4.2.2 (LINUX64 2018-02-26 16:20:21 15675)
Copyright (c) 2018, STMicroelectronics. All rights reserved.

Starting server with the following options:
Persistant Mode : Enabled
LogFile Name : /tmp/st_debug.log
Logging Level : 31
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Enabled
SWD Debug : Enabled

Atollic TrueSTUDIO gdbserver for ST-Link. Version 4.2.2 (LINUX64 2018-02-26 16:20:21 15675)
Hardware watchpoint supported by the target
STM32 device: Flash size =64
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x00000009
NVIC_CFGFSR_REG = 0x00000000
XPSR = 0x41000000
ST_LINK Major version =2 Jtag version =31
ST_LINK VID=1155 PID=14152
ST_LINK device status: HALT_MODE
ST_LINK detects target voltage =3.23 Volt
ST-Link device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61234...


When using the version from 9.2.0:
STMicroelectronics ST-LINK GDB server. Version 5.1.0
Copyright (c) 2018, STMicroelectronics. All rights reserved.

Starting server with the following options:
Persistent Mode : Enabled
LogFile Name : /tmp/st2_debug.log
Logging Level : 31
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Enabled
SWD Debug : Enabled

Hardware watchpoint supported by the target
SWD frequency = 4000 kHz
ST-LINK Firmware version : V2J31S7
Device ID: 0x410
PC: 0x0
ST-LINK Failed to get target status


Any ideas on how to solve this?

Re: Unable to connect to ST-Link/V2

Posted: Mon Dec 10, 2018 9:36 am
by Markus Girdland
Enable and check the gdbserver log to see if you can get any clues.
Feel free to post it here if you're having problems reading it and I can look through it as well.

Re: Unable to connect to ST-Link/V2

Posted: Mon Dec 10, 2018 10:36 am
by frot
[0.000] initConfigParams(): Configuration flags start
[0.000] initConfigParams(): config-file ""
[0.000] initConfigParams(): persistent false
[0.000] initConfigParams(): log-file "/home/fredrik/log/st_debug.log"
[0.000] initConfigParams(): log-level 31
[0.000] initConfigParams(): port-number 61234
[0.000] initConfigParams(): verbose true
[0.000] initConfigParams(): refresh-delay 15
[0.000] initConfigParams(): verify true
[0.000] initConfigParams(): swd true
[0.000] initConfigParams(): swo-port 61235
[0.000] initConfigParams(): cpu-clock 32000000
[0.000] initConfigParams(): swo-clock-div 32
[0.000] initConfigParams(): initialize-reset false
[0.000] initConfigParams(): debuggers false
[0.000] initConfigParams(): serial-number ""
[0.000] initConfigParams(): apid 0
[0.000] initConfigParams(): attach false
[0.000] initConfigParams(): shared false
[0.000] initConfigParams(): erase-all false
[0.000] initConfigParams(): memory-map ""
[0.000] initConfigParams(): ext-memory-loaders false
[0.000] initConfigParams(): extload ""
[0.000] initConfigParams(): stm32cubeprogrammer-path "/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.2.0/Servers/STM32CubeProgrammer/bin"
[0.000] initConfigParams(): temp-path ""
[0.000] initConfigParams(): preserve-temps false
[0.000] initConfigParams(): licenses false
[0.000] initConfigParams(): ignore-rest false
[0.000] initConfigParams(): version false
[0.000] initConfigParams(): help false
[0.000] initConfigParams(): Configuration flags end
[0.000] init(): STMicroelectronics ST-LINK GDB server. Version 5.1.0
Copyright (c) 2018, STMicroelectronics. All rights reserved.
[0.067] reset_hw_wtchpt_module(): Hardware watchpoint supported by the target
[0.070] Device_Initialise(): SWD frequency = 4000 kHz
[0.070] Device_Initialise(): ST-LINK Firmware version : V2J31S7
[0.070] Device_Initialise(): Device ID: 0x410
[0.071] Device_Initialise(): PC: 0x0
[0.072] Device_Initialise(): ST-LINK Failed to get target status
[0.072] initServerContext():
Error in initializing ST-LINK device.
Reason: [0.072] initServerContext(): Unknown. Please check power and cabling to target.