J-Link Commander 使用方法

it2024-04-18  10

J-Link Commander

   

J-Link Commander (JLink.exe) is a free command line based utility that can be used for verifying proper functionality of J-Link as well as for simple analysis of the target system with J-Link. It supports some simple commands, such as memory dump, halt, step, go etc. to verify the target connection. The J-Link Commander is part of the J-Link software and documentation package, which is available for download on the SEGGER webpage.

Contents

 [hide]  1 Perform flash download2 Batch processing3 JLink.exe return value

Perform flash download

J-Link Commander allows to download data files of different types into the flash memory of the target systems.

Connect J-Link to the PCConnect target system to J-LinkStart J-Link CommanderEnter the requested settings (e.g. target device, interface settings, etc...)Type the following commands: rloadfile <PathToFile> [<DestAddr>]J-Link Commander executes the flash download and prints out the time statistics on success.

Batch processing

Basically, some target configuration settings needs to be specified in J-Link Commander before a target connection can be established. However, the J-Link Commander comes with multiple command line options as well as a so called J-Link Commander Command Script mode, which allows using J-Link Commander in batch processing mode, so that it can be used fully automatic.

The table below describes the different command line arguments, which can be used to run the commander, without the need to input any configuration / commands:

Command line optionExplanation-device <DeviceName>Selects the target device.-if <TargetInterface>Configures the target interface.-speed <InterfaceSpeed>Configures the target interface speed.-jtagconf <IRPre,DRPre>Configures the JTAG scan configuration of the target device.IRPre==-1 and DRPre==-1 can be passed to use auto-detection (First known device will be used).-autoconnect <Value>Value==1: Forces the J-Link Commander to connect to the target, automatically.-CommanderScript <ScriptPath>Selects a J-Link Commander Command file which contains the commands for the batch mode.

Example:

JLink.exe -device CC2538SF53 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1 -CommanderScript C:\Work\JLinkCommandFile.jlink

JLink.exe return value

The return value of the J-Link Commander application (JLink.exe) can be read out int the environment variable ERRORLEVEL.

Examples:

1. Returns an Error (ERRORLEVEL == 1)

start /wait "J-Link Commander" "JLink.exe" -if InvalidInterfaceParameter ECHO error level is %ERRORLEVEL% pause

2. Returns no Error (ERRORLEVEL == 0)

start /wait "J-Link Commander" "JLink.exe" ECHO error level is %ERRORLEVEL% pause

For information how to access the environment variable ERRORLEVEL within a java application please refer to: http://stackoverflow.com/questions/8922485/how-to-execute-echo-errorlevel-in-java

For further information regarding this, please refer to: http://blogs.msdn.com/b/oldnewthing/archive/2008/09/26/8965755.aspx

 

 

附我的jlink文件 r speed 1000 device STM32F103C8 loadbin /Users/xuwen/Documents/workspace/helloarm/Debug/helloarm.bin 0x20000000 g qc

转载于:https://www.cnblogs.com/bh4lm/p/6733232.html

相关资源:Jlink 命令行自动下载程序
最新回复(0)