PlatformIO Community

JLINK debugging first try error

Yes, I have installed the drivers. But it did not work the advertised way: c:\Users\Csaba.platformio\packages\tool-jlink\USBDriver\InstDrivers.exe did not work, it stopped after the UAC. I had to start c:\Users\Csaba.platformio\packages\tool-jlink\USBDriver\x64\dpinst_x64.exe directly.

Now I have tried on a different computer, exactly the same result.

I have changed the windows language to English. The error message is>

PlatformIO: Initializing remote target…
Could not connect to J-Link.
Please check power, connection and settings…pioinit:16: Error in sourced command file:
:2331: No connection could be made because the target machine actively refused it.

Are you using this to power the target board? Or are you also supplying USB power? In this case you shouldn’t connect the JLink’s 5V to the target.

Do you have a picture of the physical setup?

Does the error stay the same when the RESET line is disconnected (it should still to a SWD reset)?

1 Like

In the current setup I do use the 5V from the probe to power the target board. I have just tried the other way, powering through the programming port without connecting 5V, did not help. The board itself is working in both setups, The LED on the probe is on, but cannot connect.

I have just tried to disconnect RESET, did not change.

Sometimes I get a popup to update the firmware. If I let it update, seems to update well, and the next time the popup does not appear.

Is this setting correct?:
Target connection timeout: 0 ms
Where can I increase it?

The “undefined” words disappeared. (It is a different PC).

This is the setup without 5V connected, board powered over USB programming port.
k%C3%A9p

Try ti run JLinkGDBServerCL.exe. Does it sees your hardware?

It does see the hardware and offers a Firmware update. It seems to install the firmware update, and reports that the update was successful, although it could not connect the hardware afterward. The next time there is no such update popup.

But the GDB connection is not sucessful:

SEGGER J-Link GDB Server V6.54c Command Line Version

JLinkARM.dll V6.54c (DLL compiled Nov 7 2019 17:01:02)

-----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: off
Init regs on start: off
Silent mode: off
Single run mode: off
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: Unspecified
Target interface: JTAG
Target interface speed: 4000kHz
Target endian: little

Connecting to J-Link…
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed…
Shutting down…
Could not connect to J-Link.
Please check power, connection and settings.

I assume I bricked my JLink clone by updating the firmware with the official one.

It’s rather unlikely that you have bricked your J-Link.

Currently, the J-Link software cannot talk to the J-Link debug probe. So conduct the following test without the Arduino connected.

  • Download and install Zadig. It’s a software for configuring USB drivers.

  • In Zadig, check Options > List All Devices.

  • You should now see two interfaces related to J-Link: CDC (Interface 0) and BULK Interface (Interface 2). Do they have the JLinkCDC and jlink driver installed?

3 Likes

Thanks, Manuel,

I can only see one J-Link entry, CDC:

k%C3%A9p

I cannot see the BULK Interface you mentioned:

k%C3%A9p

Do you think, I can repair this?

Csaba

The driver installer shows these drivers as successfully installed:

k%C3%A9p

I just realized I was using a V9 version. The V8 version shows a single interface as well and in Zadig it looks exactly like your output.

And your probe shows up as a USB device. That’s a good start.

Can you start J-Flash Vxx (a software that comes with the J-Link software) – again with just the J-Link probe (and nothing connected to it):

  • Choose Create a new project and click Start J-Flash
  • Click OK (without changing target device / interface / speed)
  • Select Target > Connect from the menu

Now an error will occur because you have no target connected. But the log output can give some hints. Does it start with something like:

Connecting...
 - Connecting via USB to J-Link device 0
 - J-Link firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46

If J-Flash can detected the J-Link version, then the communication with the probe is working correctly.

2 Likes

Bad news:
Connecting …

  • Connecting via USB to J-Link device 0
  • ERROR: Cannot connect to J-Link via USB.
  • ERROR: Failed to connect.
    Could not establish a connection to the J-Link.

But it makes a difference whether the probe is plugged in or not: when plugged in, I get a line “- Connecting via USB to J-Link device 0” and a notification about a firmware update, else I don’t.

What do you mean by whether the probe is plugged in? I understand it as J-Link plugged in to computer, which doesn’t make a lot of sense.

1 Like

I just mean that the probe is not completely dead, the J-Flash software does recognize the presence of the probe when plugged in, just cannot connect to it.

I still don’t understand the “difference whether the probe is plugged in or not”. What is plugged in to what?

Anyway, it seems your options are:

  • Try a different USB cable to make sure it’s not just the cable
  • Try a different USB port to make sure it’s not related to that
  • Try to reflash the J-Link firmware. There are several guides available. Just search for “update jlink clone”.
1 Like

Thanks, I also think I have to reflash.
It will be some hassle, because there are no ERASE and TST jumpers on my PCB, but I will figure it out.

Thank you for your help!

Update:
I sent back my V8 probe to Amazon and received a V9 version (looks the same).
This works like a charm.
Now that I see how comfortable it is to debug in platformio, I am ordering an original JLINK EDU mini.

The only thing that did not work was the green restart button. It complained that a file is in use. Stopping and starting again worked.

Thank you for your help and assistance.
Csaba

Would you mind linking the amazon page what version worked nicely for you?
I’m also using the J-Link EDU Mini, which works like a charm compared to other stuff that I had rather a lot of problems with.

I got mine form AliExpress:

If you were to order these, there is no guarantee that you will get the same ones as I did. Most AliExpress stores are not manufactures but dealers. When they are short on stock, they will order from the supplier that can deliver a similar enough item at the lowest price.

1 Like

This is the one that works here:

I think the most important thing is to get a V9.

By the way, the plastic housing is identical, therefore the pictures don’t tell the difference.

1 Like