Controlling Target Power and Licenses with J-Link Commander

Written by

in

How to Verify J-Link Connections with J-Link Commander SEGGER J-Link is the industry standard for debugging and programming ARM Cortex-M and other embedded microcontrollers. However, when a debugging session fails, it can be difficult to tell if the issue lies with the debugger, the cables, or the target board itself.

J-Link Commander (JLink.exe) is a free, powerful command-line utility included in the SEGGER J-Link Software and Documentation Pack. It is the best tool for diagnosing connectivity issues, checking probe firmware, and validating target power.

This article walks you through the steps to verify your J-Link connection, from initial setup to checking target communication. Prerequisites

A SEGGER J-Link probe (J-Link Base, Plus, Ultra+, Pro, or OB). Target board connected to the J-Link probe.

J-Link Software and Documentation pack installed on your PC. Step 1: Physical Setup and Power

Before starting the software, ensure the physical connections are solid. Connect the J-Link probe to your PC via USB.

Connect the J-Link probe to your target board via JTAG/SWD (usually a 10-pin or 20-pin connector).

Power your target board using its onboard regulator, battery, or USB power. The J-Link cannot usually power the target board unless configured to do so. Step 2: Launching J-Link Commander

Open the J-Link Commander application (shortcut usually created on the desktop, or run JLink.exe from the installation folder).

The application will automatically detect connected J-Link probes.

If successful, you will see a text-based interface displaying the J-Link serial number, firmware version, and hardware version. Step 3: Setting Target Device and Interface

Upon startup, or by typing connect in the console, you will be prompted to enter the connection parameters:

Device: Type your device name (e.g., STM32F103C8) to ensure correct configuration.

Interface: Select SWD (Serial Wire Debug) or JTAG. SWD is recommended for most modern Cortex-M boards.

Speed: Accept the default speed or enter a lower speed (e.g., 1000 kHz) if you have long or noisy cables.

Target Power: The tool will ask if it should power the target. If your board is already powered, select off or No. Step 4: Validating the Connection (The “Found” Check)

After entering the parameters, J-Link Commander will attempt to communicate with the target CPU. Look closely at the log output:

Successful Connection: You should see Found 1 J-Link devices and, crucially, Found Cortex-M… or a specific device ID.

Voltage Check: Look at the VTref value. This indicates the voltage on the target board’s debug connector. It should read 3.3V or 1.8V depending on your target. If it reads 0.0V, your target is not powered or the JTAG cable is not connected correctly.

// Example of a successful connection J-Link>connect Device> STM32F103C8 TIF> S Speed> 1000 Found 1 J-Link device … Found Cortex-M3 r1p1, Little endian. Use code with caution. Step 5: Testing Target Access (Basic Debugging)

To ensure the connection is stable, run these simple commands:

halt: This command attempts to pause the CPU core. If it works, it means the J-Link has control over the target. regs: Displays the current CPU registers.

mem32 0x00000000, 10: Dumps 10 words of memory from address 0x0, allowing you to see if you can read the flash memory. go: Resumes execution of the target. Troubleshooting Common Connection Issues If J-Link Commander cannot connect, check the following:

Could not find J-Link: Check USB drivers. Run the J-Link USB driver installer.

VTref = 0.0V: The target board is not powered. Check target power supply and JTAG cable connections. Cannot connect to Target: Reduce the interface speed to a low value, like 500 kHz. Ensure the Target Interface (SWD/JTAG) is correctly chosen.

If the target is locked or has low-power modes active, you may need to use the connect command and select the “connect under reset” option. Conclusion

By following these steps, you can rapidly determine if your connection issues are caused by poor cabling, lack of target power, or incorrect configuration. J-Link Commander is an indispensable tool in any embedded engineer’s toolkit.

For more information and a complete list of commands, refer to the SEGGER J-Link Commander Wiki page. Key Takeaways

Use J-Link Commander for rapid debugging of connection issues. Verify VTref is not 0.0V to ensure target power.

Use connect to re-initialize the connection and set the device. If you’d like, I can:

Show you how to use J-Link Commander to flash a .hex or .bin file.

Explain how to read from and write to specific memory registers.

Walk through using J-Link Commander for JTAG chain troubleshooting. Let me know if any of these would be helpful! J-Link Commander – SEGGER Knowledge Base

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

More posts