In the project settings, under "Debug", select Hardware Simulation on the right, click the drop-down box to select "J-LINK/J-TRACE", and then click "Setting"
In the pop-up window, under "Debug", select "JTAG" or "SW", and then select the download rate.
Click on the Trace tab, if you select SW
Check the "Enable" option, enter the actual working clock frequency of the MCU in the "Core" box (that is, the frequency at which the microcontroller executes instructions, which MDK will use to calculate the time), and then check "Autodetect max SW0 Clock"
If you select "JTAG",
First check "Enable", set the clock frequency in "Core", and finally remove the "Enable" just checked.
Because the "JTAG" mode does not support the "Trace" function, the simulation will report an error if "Enable" is not removed.
Next, click to enter the simulation, and there will be a time window in the lower right corner of the interface
If you right-click the mouse on it, you will see:
The top two are for resetting "t1" and "t2", and the bottom three are for selecting which time to display on the status bar.
"t0" indicates the time from the start of the program to the present, and cannot be reset. The other two can be reset at will, and can be used to measure the running time of a specific function or a line of program.
The specific operation is: add a breakpoint before the code to be tested. When the program runs to the target line, it will stop, then reset "t1" or "t2", and add a breakpoint before the next line of code. Then continue running the program. The program will stop before the next line of code. At this time, the value of "t1" is the running time of the target line program.
Previous article:Pitfalls of using st-link to download programs to stm8 through stvp
Next article:The meaning of RO-data, RW-data, and ZI-data in Keil
- 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
- mRNA vaccine badge
- Generate compensation ramp
- TI's Ultrasonic Sensing Technology for Flow Measurement
- [Visible] Intangible necessities
- Purgatory Legend-RAM War.pdf
- AD19, making 3D animation, "The 3D Movie Panel is disabled in 2D" How to solve it?
- Guitar Shaped Audio PCB Amplifier
- 26 "Wanli" Raspberry Pi car - program startup
- Among the working modes of switching power supplies, which switching mode is both economical and affordable?
- Simple example of DSP interrupt configuration