J-Link cannot connect to the CPU

From SEGGER Wiki
Revision as of 11:28, 14 July 2016 by Erik (talk | contribs) (Target connection)
Jump to: navigation, search

There are many different scenarios, which may prevent the J-Link from establishing a successful connection to the target device. The following article refers to the different scenarios and provides information on how to troubleshoot and in the next step how to fix them. In general, we recommend to verify the correct connection between J-Link and the target device using the diagnostic utility J-Link Commander before moving to the actual environment (e.g. Embedded Studio IDE). Therefore, this article refers to J-Link Commander and assumes that the J-Link Software and Documentation package (incl. J-Link USB driver) is installed. We recommend to work through this article from the beginning to the end.

J-Link connection

First, verify that the connection between the J-Link and PC is functional and J-Link Commander can communicate with the J-Link successfully:

  • Connect J-Link via USB to the PC
  • Start J-Link Commander
  • If the J-Link is functional, you should see that the J-Link Commander reports USB connection O.K. and outputs the firmware string:

Troubleshoot JLinkCommander.png

Connection is unsuccessful

If the connection is not successful, please follow the steps below and perform the test above again.

  • Reboot the PC to make sure that the USB protocol itself is not in a confused state
  • Exchange the USB cable
  • Try a different USB slot
  • If a USB hub is used, remove it
  • Verify that the J-Link USB driver is installed
  • Switch to a different PC to exclude PC related issues

If you followed the steps above and J-Link Commander is still not able to connect to the J-Link, please write us an e-mail to XXX. The e-mail should include the serial number of the affected unit as well as the answer to the questions below:
If you physically connect the J-Link to the PC via USB:

  • Does the green LED of the J-Link lit?
  • Does the Windows device manager show the J-Link in the list of USB devices?
  • Please send us a screenshot of the J-Link Commander while the J-Link is connected via USB to the PC.

Target connection

In general, we recommend to use an evaluation board to verify the correct functionality between the J-Link and the target device before moving to a custom hardware in order to exclude issues which might be caused by an incorrect hardware design.

Verify functionality using J-Link Commander

  • Connect the J-Link via USB to the PC
  • Power the target device
  • Connect the target device with the J-Link
  • Start J-Link Commander and follow the startup configuration instructions


Problems

After programming the target device, J-Link is no longer able to establish a connection

This can have different reasons as for example the application does disable the debug interface, re-configures the debug pins, enters some kind of low-power-mode, etc...In order to prevent such situations during the development process, we recommend to add an delay of one second before the actual application code is executed. This allows to perform a reset and halt the CPU before the CPU executes the "bad code" which would prevent the J-Link to establish a successful connection. Apart from this, we recommend to select the correct device as this allows the J-Link DLL to perform special handling like for example halt in bootloader or connect under reset.