Jlink is a product of Segger. Jlink officially provides debugging software and drivers. The debugging software includes jlink command (j-tag debugging), j-mem (memory viewing), j-flash (flash burning), etc. I mainly use jlink commander. The following is its command set:
SEGGER J-Link Commander V4.20h ('?' for help)
Compiled on October 5, 2010 at 19:11:57
DLL version V4.20h, compiled on 2010-10-05 19:11:41
Firmware: J-Link ARM V8 compiled on May 5, 2010 08:59:59
Hardware: V8.00
S/N:20100214
Features: RDI, FlashDL, FlashBP, JFlash, GDBFull
VTarget = 3.280V
Message: TotalIRLen=? , IRPrint = 0x..FFFFFFFFFFFFFFFFFFFF1
WARNING: No CPU cores found.
No device was found on the JTAG chain. Trying to find a device on SWD.
WARNING: No CPU cores found.
****** Error: Parity error (Data = 0xFFFFFFFF, ReceivedParity = 1)
There are no devices in SWD.
No cores found
Info: TotalIRLen = 9, IRPrint = 0x0011
Found 2 JTAG devices, total IRLen = 5:
#0 Id: 0x2B900F0F, IRLen: 04, IRPrint: 0x0, ARM ETB
#1 Id: 0x07B76F0F, IRLen: 05, IRPrint: 0x1, ARM1176 Core
ARM11 is confirmed.
J-Link>
The available commands are:
----------------------
fFirmware Information
hStop
g go
Sleep waits for a given time in milliseconds. Syntax: sleep
s Single-step target chip
st shows the hardware status
hwinfo displays hardware information
mem reads memory Syntax: mem, (hexadecimal)
mem8 reads 8-bit items. Syntax: mem8, (hexadecimal)
mem16 reads 16-bit items. Syntax: mem16, (hexadecimal)
mem32 reads 32-bit items. Syntax: mem32, (hexadecimal)
w1 writes an 8-bit item. Syntax: w1, (hexadecimal)
w2 writes 16-bit items. Syntax: w2, (hexadecimal)
w4 writes a 32-bit item. Syntax: w4, (hexadecimal)
wm write test word. Syntax: wm
It is the length of the scan chain selection register.
ms measures the length of the scan chain. Syntax: ms
mr measures the RTCK reaction time. Syntax: mr
qExit
qc closes the JLink connection and exits
rReset target (RESET)
rx reset target (RESET). Syntax: rx
RSetType sets the current reset type. Syntax: RSetType
Register Displays the contents of the register
wreg writes to a register. Syntax: wreg,
SetBP sets a breakpoint. Syntax: SetBP [A/T] [S/H]
SetWP Set Watchpoint. Syntax: [R / W] [ [] [A-Mask]]
ClrBP clears the breakpoint. Syntax: ClrBP
ClrWP clears the watchpoint. Syntax: ClrWP
VCatch write vector capture. Syntax: VCatch
loadbin loads a binary file into target memory.
Syntax: loadbin ,
savebin saves the target memory as a binary file.
Syntax: savebin , ,
SetPC sets PC to the specified value. Syntax: SetPC
le changed to little endian mode
Change to big endian mode
Log enables logging to a file. Syntax: log
unlock unlocks the device. Syntax: unlock
Type unlock no to get a list
The supported device names.
nRESET must be connected
---- CP15 ------------
rce reads CP15. Syntax: rce, , ,
wce writes CP15. Syntax: wce, , , ,
- - ice- - - - - - -
Embedded ICE macrocell (ICE breaker) showing ICE status
ri Read Ice reg. Syntax: ri (hexadecimal)
wi writes ice reg. Syntax: wi, (hexadecimal)
---- ETM -------------
etm shows ETM status
re read ETM reg. Syntax: re
We write ETM reg. Syntax: We, (hexadecimal)
es start tracking
----ETB-------------
etb shows ETB status
rb reads the ETB register. Syntax: rb
wb writes to the ETB register. Syntax: wb, (hexadecimal)
---- TRACE -----------
TAddBranch TRACE - Adds a branch instruction to the trace buffer. Paras:,
TAddInst TRACE - Adds a (non-branch) instruction to the trace buffer. Syntax:
TClear TRACE - Clear the buffer
TSetSize TRACE - Sets the size of the trace buffer
TSetFormat TRACE - SetFormat
TSR TRACE - Display regions (and analyze trace buffer)
TStart TRACE - Start
TStop TRACE - Stop
---- SWO -------------
SWOSpeed SWO - Displays supported speeds
SWOStart SWO - Start
SWOStop SWO - Discontinued
SWOStat SWO - Displays SWO status
SWORead SWO - Read and display SWO data
SWOShow SWO - Read and analyze SWO data
SWOFlush SWO - refresh data
----File I/O--------
fwrite writes the file to the emulator
fread reads a file from the simulator
fshow reads and displays a file from the simulator
fdelete deletes files on the simulator
fsize displays the size of the file on the simulator
----test------------
thg run/stop 1000 times
ts runs the step 1000 times
testwspeed tests the download speed. Syntax: testwspeed [ []]
testrspeed tests the upload speed. Syntax: testrspeed [ [ ] [
S>]]
testcspeed tests the CPU speed. Syntax: testcspeed []
---- JTAG ------------
Configuration sets the number of IR/DR bits before ARM devices.
Syntax: configure ,
Speed sets the JTAG speed. Syntax: speed| auto| adaptive, for example, speed 2000,
Speed
I read the JTAG ID (Host CPU)
wjc Write JTAG command (IR). Syntax: wjc (hexadecimal)
wjd writes JTAG data (DR). Syntax: wjd (hexadecimal), (decomposition)
RTAP resets the TAP controller using the state machine (111110)
wjraw writes raw JTAG data. Syntax: wjraw, ,
rt resets the TAP controller (nTRST)
---- JTAG Hardware ---
c00 creates clock with TDI = TMS = 0
c clock
0 Clear TDI
1 Setting up TDI
t0 Clear TMS
t1Set TMS
trst0 clear TRST
trst1 sets TRST
r0 clear reset
r1 sets RESET
----connect------
usb connects to the J-Link via USB. Syntax: usb where port is 0..3
ip connects to the J-Link ARM Pro or J-Link TCP/IP Server via TCP/IP.
Syntax: ip
----Configuration---
si selects the target interface. Syntax: si,
Where 0 = JTAG, 1 = SWD.
Power switches the power to the target. Syntax: power [perm]
State is either on or off. Example: Power on
wconf write configuration bytes. Syntax: wconf,
rconf reads the configuration bytes. Syntax: rconf
usbaddr assigns the usb address to the connected J-Link: Syntax: usbaddr =
ipaddr displays/assigns the IP address and subnet mask of the connected J-Link.
gwaddr displays/assigns the connected J-Link network gateway address.
dnsaddr displays/assigns the network DNS server address of the connected J-Link.
conf shows the configuration of the connected J-Link.
ecp enables the J-Link control panel.
Calibrate calibrates the target current measurement.
----------------------
Note: Specify the file name on the command line
Will start J-Link Commander in script mode.
To summarize the commands we use most:
USB -------- Connect to target board
[R----------Restart the target board
Stop-------Stop the program running on the CPU
loadbin ---- load an executable binary file
g ----------jump to the code segment address to execute
s ----------single-step execution (for debugging)
setpc -----set the value of the pc register (for debugging)
setbp -----set a breakpoint
-------Scratchpad read register organization
WREG -------Write register
MEM --------Read memory
W4 ---------Write Memory
Turn off mmu --- Turn off mmu, which is very important for bare board debugging
w4 cpsr, 0x0000001f ------ Switch to system mode
Speed------Set the transmission rate of jtag
rce 0, c0, c0, 0 -----Set the first register of cp15 register to 0
Previous article:STM32 learning 003_STM32F10X clock configuration
Next article:STM32 Learning 005_Port Multiplexing and Remapping
Recommended ReadingLatest update time:2024-11-16 01:36
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Chint ZTW0111A Digital Multimeter Disassembly and Evaluation
- 【TouchGFX Design】First experience based on F746DISCOVRY
- CircuitPython 4.0.0 is now available
- Embedded Software Engineer
- Win Jingdong Cards to fight against indoor air hazards - Infineon XENSIV PAS CO2 sensor
- MicroPython adds UF2 firmware format for esp32-S2/S3 chips
- Verilog data splicing and splitting.zip
- EEWORLD University ---- Data Structure and Algorithm
- How to use diodes to achieve output of different voltages in a microcontroller?
- MSP340 MCU IAR-Simple Traffic Light System Proteus Simulation Program