Summary of Keil online debugging methods

Summary of Keil online debugging methods

1. Basic configuration method:Insert image description hereInsert image description here
Introduce the difference between the two (reprinted)
JTAG (Joint Test Action Group, Joint Test Action Group) is an international standard test protocol (IEEE 1149.1 compatible), mainly used for internal chip testing, and now most All devices support JTAG protocol, such as ARM, DSP, FPGA, etc. For microcontrollers with JTAG interface, you need to use J-Link (USB to JTAG) to download the debugging program via computer USB.
The standard JTAG is four lines: TDI, TMS, TCK, TDO, which correspond to data input, mode selection, clock, data output, and reset pins respectively.
Insert image description here

The full name of SWD is Serial Wire Debug. When using JLink to debug our board in SWD mode, we use standard second-line DIO and CLK. The RESET pin does not need to be connected. When you frequently fail to download, you can connect the RESET pin. Pin and try again.
In high-speed mode, SWD is more reliable than JTAG. The common wiring signals are as follows, you can choose according to the specific situation.
Insert image description here
Let’s summarize the differences between JTAG and SWD download modes:
JTAG has more wiring, and the stability in high-speed mode is not as good as SWD;
SWD has fewer wiring, which can free up excess GPIO, and the required wiring signals will be different in different emulators (mainly in VCC and RESET), DIO and CLK must be connected;

Insert image description here
2. Basic operation methods:
1) Introduction to icons:
Insert image description here
The shortcut keys corresponding to the above icons are:

Reset resets the program to the starting point and returns to the initial state.
Run at full speed (F5) to keep the program running. This button is active when the program is stopped.

Stop stops the running program and stops it. This button is active while the program is running.

Step single-step operation (F11), each time the button is clicked, the program runs one step (single step), and when it encounters a function, it will jump into function execution (the arrow enters the bracket). This button is active when the program is stopped.

Step Over runs step by step (F10). Each time the button is clicked, the program runs one line (single line). When a function is encountered, the function execution is skipped (the arrow skips the brackets). This button is active when the program is stopped.

Step Out (Ctrl + F11), each time you click the button, the program will jump out of the current function execution (the arrow jumps out of the brackets) until it jumps out of the outermost function (main function). This button is active when the program is stopped.

Run to Cursor Line Run to the cursor line (Ctrl + F10), place the cursor on a certain line, click this button, the program will run at full speed until it stops at the cursor position. (The premise is that the program can run to the line where the cursor is).

2) Peripheral register window:
Insert image description here
3) Variable monitoring window:
Insert image description here

3. Debugging experience:
1) First set a breakpoint, and then use the debugging step to debug the program.
2) Set some global variables appropriately, observe the changes in values, and see whether the number of program executions reaches your expectations.

Guess you like

Origin blog.csdn.net/weixin_44236302/article/details/124905019