Monday, December 11th 2017, 4:45am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jgroff

Beginner

Date of registration: Dec 7th 2017

Posts: 5

1

Thursday, December 7th 2017, 5:39pm

Issues switching from ST-LINK to J-LINK

Hoping someone could assist with a problem I'm having. I recently purchased a J-link Ultra+ to replace the ST-LINK V2 I am using for a project. I am using True Studio.

I am connecting to the target CPU (STM32F746) via SWD, and I've been able to connect and program/debug the chip just fine using the ST-LINK programmer. However I cannot connect using the J-link device. I get the following output:


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SEGGER J-Link GDB Server V6.22b Command Line Version

JLinkARM.dll V6.22b (DLL compiled Dec 6 2017 17:02:06)

Command line: -port 2331 -s -CPU Cortex-M -device STM32F746VG -endian little -speed 4000 -if swd -vd -rtos C:\Program Files (x86)\Atollic\TrueSTUDIO for ARM 8.0.0\Servers\J-Link_gdbserver\GDBServer\RTOSPlugin_FreeRTOS.dll -swoport 2332
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: localhost only
Generate logfile: off
Verify download: on
Init regs on start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: STM32F746VG
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Ultra V4 compiled Nov 28 2017 11:47:50
Hardware: V4.00
S/N: 504403398
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.31 V
Listening on TCP/IP port 2331
Connecting to target...ERROR: STM32: Connecting to CPU via connect under reset failed.



Could someone assist in working out what's different between the two?

Thanks!

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 430

2

Thursday, December 7th 2017, 6:01pm

Hello,

Thank you for your inquiry.
Such an issue is not known to us.

When setting up True Studio did you folow the following guide? https://www.segger.com/products/debug-pr…lic-truestudio/

The log suggests that the connect under reset is not working. Is the reset pin from the MCU connected to J-Link?
Are you using an eval board or custom hardware?
To get True Studio out of the equation could you run J-Link Commander (one of the programs in the J-Link Software and Documentation pack) and post a screenshot of the whole connection sequence?

How to is described here: https://wiki.segger.com/J-Link_cannot_connect_to_the_CPU

Best regards,
Nino

jgroff

Beginner

Date of registration: Dec 7th 2017

Posts: 5

3

Thursday, December 7th 2017, 6:34pm

Custom hardware. The reset pin from the MCU is not connected. We have limited space for a programming/debugger connection and elected to leave that pin off because we understood that, though useful, it was not necessary. The pins that are connected are GND, VDD, SWDIO, SWCLK, and SWO. Is there a setting that needs to be changed to allow for that?

Commander output:

SEGGER J-Link Commander V6.22b (Compiled Dec 6 2017 17:02:44)
DLL version V6.22b, compiled Dec 6 2017 17:02:06

Connecting to J-Link via USB...O.K.
Firmware: J-Link Ultra V4 compiled Nov 28 2017 11:47:50
Hardware version: V4.00
S/N: 504403398
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
VTref = 0.000V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. : STM32F746VG
Type '?' for selection dialog
Device>?
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>S
Specify target interface speed [kHz]. : 4000 kHz
Speed>
Device "STM32F746VG" selected.


Connecting to target via SWD
Cannot connect to target.
J-Link>

jgroff

Beginner

Date of registration: Dec 7th 2017

Posts: 5

4

Thursday, December 7th 2017, 10:10pm

I apologize, I messed up in my previous post. Please see the following for the correct output from the commander.



Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. : STM32F746VG
Type '?' for selection dialog
Device>?
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>S
Specify target interface speed [kHz]. : 4000 kHz
Speed>
Device "STM32F746VG" selected.


Connecting to target via SWD
Cannot connect to target.
J-Link>connect
Device "STM32F746VG" selected.


Connecting to target via SWD
STM32 (connect): Can not attach to CPU. Trying connect under reset.
STM32 (connect): Can not attach to CPU. Trying connect under reset.

****** Error: STM32: Connecting to CPU via connect under reset failed.

STM32 (connect): Can not attach to CPU. Trying connect under reset.
STM32 (connect): Can not attach to CPU. Trying connect under reset.

****** Error: STM32: Connecting to CPU via connect under reset failed.

Cannot connect to target.

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 430

5

Friday, December 8th 2017, 10:01am

Hello,

Have you connected the MCU supply voltage to the VTref pin (Pin 1) of the debug interface?
I ask because J-Link Commander is outputting VTref = 0.000 V
As our debug probes can work with ~10000 different devices a wide range different signal voltages is needed.
Generally we support 1.2 V - 5 V. If you do not connect VTref J-Link does not know what voltage to supply and thus will not establish connection to protect your device from damage.
How to wire the debug interface is explained here: https://www.segger.com/products/debug-pr…ion/#tab-4031-2
RESET is optional but we recommend to connect it anyways so J-Link has the chance to connect to devices that would be otherwise unrecoverable e.g. due to a "bad" application running that disables the debug interface.

If you have spacing problems we offer a adapter that supplies Pin 1 with the wanted voltage without needing a connection from the target itself.
More information can be found here: https://www.segger.com/products/debug-pr…supply-adapter/

So could you try connecting Pin 1 with the target supply voltage and see if this resolves your issue?

Best regards,
Nino

jgroff

Beginner

Date of registration: Dec 7th 2017

Posts: 5

6

Friday, December 8th 2017, 3:34pm

The VDD wasn't connected properly..that was odd. I made sure all of the pins are connected now. I'm unfortunately still getting the same error. Here is a log from a clean power-on.


SEGGER J-Link Commander V6.22b (Compiled Dec 6 2017 17:02:44)
DLL version V6.22b, compiled Dec 6 2017 17:02:06

Connecting to J-Link via USB...O.K.
Firmware: J-Link Ultra V4 compiled Nov 28 2017 11:47:50
Hardware version: V4.00
S/N: 504403398
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
VTref = 3.312V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. : STM32F746ZG
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>s
Specify target interface speed [kHz]. : 4000 kHz
Speed>
Device "STM32F746ZG" selected.


Connecting to target via SWD
STM32 (connect): Can not attach to CPU. Trying connect under reset.
STM32 (connect): Can not attach to CPU. Trying connect under reset.

****** Error: STM32: Connecting to CPU via connect under reset failed.

STM32 (connect): Can not attach to CPU. Trying connect under reset.
STM32 (connect): Can not attach to CPU. Trying connect under reset.

****** Error: STM32: Connecting to CPU via connect under reset failed.

Cannot connect to target.
J-Link>

jgroff

Beginner

Date of registration: Dec 7th 2017

Posts: 5

7

Friday, December 8th 2017, 3:43pm

I don't know that it's going to help, but here's what I get when I connect with ST-Link


08:42:23 : ST-LINK SN : 56FF73066772565655330467
08:42:23 : ST-LINK Firmware version : V2J27S6
08:42:23 : Connected via SWD.
08:42:23 : SWD Frequency = 4,0 MHz.
08:42:23 : Connection mode : Connect Under Reset.
08:42:23 : Debug in Low Power mode enabled.
08:42:23 : Device ID:0x449
08:42:23 : Device flash Size : 1MBytes
08:42:23 : Device family : STM32F74x/F75x