J-Link Commander 使用方法

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

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 PC
  • Connect target system to J-Link
  • Start J-Link Commander
  • Enter the requested settings (e.g. target device, interface settings, etc...)
  • Type the following commands:
    • r
    • loadfile <PathToFile> [<DestAddr>]
  • J-Link Commander executes the flash download and prints out the time statistics on success.

JLinkCommander FlashDownload.png

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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值