Hello,
I kindly ask for help regarding the repetedly upcoming "Could not connect to target" problem. This problem is not new - frustrating.
I am sure the problem is quite common and there should exist a more or less simple solution but I cannot find one, neither here in any NXP forum nor elswhere. I have seen [could-not-connect-to-target-Jlink-MCUXpresso/m-p/856208#M3486], but I could not see a solution for me in this post.
Software:
Windows 10 Pro, Version 2004, Build 19041.1052. But this doesn't seem to be relevant as the problem exists already several years on at least 2 different computers and several versions of Windows 8 and 10.
The problem came up with
- both, LPCXpresso and MCUXpresso, current version is "MCUXpresso IDE v11.3.0 [Build 5222] [2021-01-11]", all updates installed, 202106241228_SupportInfo.zip is available if necessary.
- LPC-Link (several samples, mostly working, sometimes not),
- a freshly acquired Link-2 (migration to MCUXpresso this year) never worked, but I was in a hurry and bought a...
- Segger J-Link EDU mini V1 which worked for some time. But now the problem seems to establish with this debugger and I'm getting tired of all this...
A part of the problem might be that I sometimes also use ST-Microsystem's CUBE IDE. But I'm 100% sure that I did NOT use CUBE for debugging before the problem occurred this time (I never debugged the my STM stuff on the new computer). But perhaps installing CUBE might contribute.
I use my own extremely simple LPC812-hardware, not much more than a controller breakout. As it mostly works I don't think that it contributes to the problem.
This is the log of the J-Link GDB Server:
-------BEGIN------------
[24-6-2021 10:59:26] Executing Server: "C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe" -nosilent -swoport 2332 -select USB=801006574 -telnetport 2333 -singlerun -endian little -noir -speed auto -port 2331 -vd -device LPC812M101 -if SWD -halt -reportuseraction
SEGGER J-Link GDB Server V6.88c Command Line Version
JLinkARM.dll V6.88c (DLL compiled Dec 4 2020 18:05:56)
Command line: -nosilent -swoport 2332 -select USB=801006574 -telnetport 2333 -singlerun -endian little -noir -speed auto -port 2331 -vd -device LPC812M101 -if SWD -halt -reportuseraction
-----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: LPC812M101
Target interface: SWD
Target interface speed: auto
Target endian: little
Connecting to J-Link...
$$UserActionStart$$: Terms of use
$$UserActionEnd$$: Terms of use
J-Link is connected.
Device "LPC812M101" selected.
Firmware: J-Link EDU Mini V1 compiled Feb 18 2021 11:25:23
Hardware: V1.00
S/N: 801006574
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.11 V
Listening on TCP/IP port 2331
Connecting to target...
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.
Server has been shut down.
-------END-----------
There is another message from the IDE:
--BEGIN--
Failed to execute the MI command:
-target-select remote localhost:2331
Error message from debugger back end:
localhost:2331: Es konnte keine ... verweigerte.
--END--
repeated 3 times under "Details>>".
Note that the target voltage obviously was measured (3.11 V but sometimes 3.10 V - therefore this is not a setting but a measurement result) and there must have been some working connection.
Please:
- Is there an understandable explanation of what happens?
- Is there a way to solve this "FOREVER"? Or, at least,
- is there a simple way (checklist for connection and settings...) to quickly and reproducibly solve the problem when it comes up?
Kind regards,
Helmut