Unable to connect to ST-Link/V2

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

frot
Posts: 6
Joined: Thu Dec 06, 2018 3:05 pm

Unable to connect to ST-Link/V2

Postby frot » Thu Dec 06, 2018 3:20 pm

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?

Markus Girdland
Posts: 148
Joined: Thu May 11, 2017 11:27 am

Re: Unable to connect to ST-Link/V2

Postby Markus Girdland » Mon Dec 10, 2018 9:36 am

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.

frot
Posts: 6
Joined: Thu Dec 06, 2018 3:05 pm

Re: Unable to connect to ST-Link/V2

Postby frot » Mon Dec 10, 2018 10:36 am

[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.

sai
Posts: 2
Joined: Sat Nov 10, 2018 1:48 pm

Re: Unable to connect to ST-Link/V2

Postby sai » Tue Dec 18, 2018 4:51 am

Try updating the ST-LINK firmware to the latest version.
I too got the same problem but in my case I downloaded the STM32-ST Link Utility and tried connecting to the board through that tool.
It showed an option connect when I clicked on it, it asked for update the firmware to the latest version. I updated and now it's working fine.

frot
Posts: 6
Joined: Thu Dec 06, 2018 3:05 pm

Re: Unable to connect to ST-Link/V2

Postby frot » Tue Dec 18, 2018 9:34 am

Atollic comes with a firmware update that I already installed.
After your tip (thank you!) I downloaded the latest firmware from ST (V2J32S7) which is newer than the version included with Atollic 9.2.0.
Unfortunately still not working.

Can connect with st-util, openocd, Rowley Crossworks 4, Atollic 9.0.1
Later versions of Atollic does not work.

sai
Posts: 2
Joined: Sat Nov 10, 2018 1:48 pm

Re: Unable to connect to ST-Link/V2

Postby sai » Sat Dec 22, 2018 4:37 am

Have you updated the drivers from ST community ST-Link/v2 009 in your PC ?

frot
Posts: 6
Joined: Thu Dec 06, 2018 3:05 pm

Re: Unable to connect to ST-Link/V2

Postby frot » Fri Dec 28, 2018 9:38 am

Forgot to mention I'm on Linux. Kind of important when troubleshooting... Sorry.
I will look for updated usb-drivers.

frot
Posts: 6
Joined: Thu Dec 06, 2018 3:05 pm

Re: Unable to connect to ST-Link/V2

Postby frot » Tue Jan 08, 2019 9:47 am

I can't find any updated drivers.
As I mentioned above, the same debugger and target works with all other tools I have tried. It's only later versions of Atollic that gives me trouble.

frot
Posts: 6
Joined: Thu Dec 06, 2018 3:05 pm

Re: Unable to connect to ST-Link/V2

Postby frot » Fri Jan 25, 2019 2:24 pm

Managed to get hold of a new ST-LINK/V3 device.
After updating the product id in the provided udev rules to 374f (was 374e in the file) I can connect to the target with TrueSTUDIO 9.2.0.

Since the V3 debuggers also have other benefits this will be our solution to this problem.


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest