STM32 Learning 004_Debugging Tool J_LINK

Publisher:玄幻剑客Latest update time:2017-10-26 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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


Keywords:STM32 Reference address:STM32 Learning 004_Debugging Tool J_LINK

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

STM32 Ultrasonic Distance Measurement
The ultrasonic distance measurement module is HC-SR04. The C-SR04 ultrasonic distance measurement module can provide non-contact distance sensing function of 2cm-400cm. The distance accuracy can reach up to 3mm; the module includes an ultrasonic transmitter, a receiver and a control circuit. HC-SR04 basic working prin
[Microcontroller]
STM32 Ultrasonic Distance Measurement
STM32 uses HAL library to use usart_DMA problem
One concept that needs to be understood here is that when using the hal library, you must first have a good understanding of the use of peripherals in the standard library. The reason for this problem in my case is that I did not understand the use of peripherals in the standard library well enough, which led to vario
[Microcontroller]
STM32 independent watchdog: you see the dog is independent
STM32--Software Watchdog--No hardware support is needed--it is already integrated in the IC. (It is a misunderstanding of independent watchdog) A countdown, decreasing, decreasing, decreasing, decreasing, when it decreases to 0, it will trigger a system reset signal, which means the microcontroller restarts. How t
[Microcontroller]
Note on calling system functions in interrupts when using freertos in STM32
The priority of the CORTEX kernel is that the smaller the value, the higher the priority, that is, 0 is the highest priority. FreeRTOS is just the opposite. In order to meet the high real-time requirements of some applications for interrupts, after the interrupt priority is higher than a certain value, the kernel func
[Microcontroller]
STM32 development board development notes (4) - startup settings
stm32 has a boot pin Boot0 and Boot1, which are used to set the startup position of the code As shown below Boot0 is located at pin 94, which is a dedicated Boot pin. Boot1 is located at pin 37 and is multiplexed with PB2. Boot1 Boot0 x 0: boot0 is 0, boot1 is any value, the code starts from the internal
[Microcontroller]
STM32 development board development notes (4) - startup settings
STM32 defines constant array to FLASH fixed address
Method: static const uint8_t s_acBmpLogo030 __attribute__((at(0X800F000)))={0x80,0xC0,0xC0,0xC0,0xC0,0x80,xxxxxxx}   After compiling, you can see the assigned address in the .map file 0x0800f000   0x0000005c   Data   RO         4013    .ARM.__AT_0x0800F000  main.o   This is the flash data viewed from the debug window
[Microcontroller]
STM32 defines constant array to FLASH fixed address
34. Memory Management
1. Introduction to Memory Management 1. Why use memory management?  For example, how to browse SD card files on LCD If there is memory available for memory management, apply for memory and release it for other use after use. There is no need to define a large array in advance to occupy a lot of memory. 2. What is
[Microcontroller]
34. Memory Management
Multi-channel voltage measurement design based on STM32
  1. Introduction   In recent years, data acquisition and its application have received more and more attention, and data acquisition systems have also developed rapidly. It can be widely used in various fields.   Data acquisition technology is one of the important branches of information science. Data acquisition
[Microcontroller]
Multi-channel voltage measurement design based on STM32
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号