In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
What this article shares with you is what software simulation and hardware simulation refer to. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it with the editor.
Software simulation
Keil has a very powerful software simulation function, and many problems can be found through software simulation. Keil simulation can view many hardware-related registers, and we can know whether the code is running normally by observing the changes of these register values. This can avoid frequently downloading programs and prolong the life of single-chip microcomputer Flash.
Before you start the simulation, configure some options.
Set the chip model and crystal frequency in the engineering settings.
Step one:
Step 2:
Select "Use Simulator" in the "Debug" tab to indicate the use of software simulation; select "Run to main ()" to skip the assembly code and jump directly to the main function to start the simulation. Set the "Dialog DLL" items below to "DARMSTM.DLL" and "TARMSTM.DLL", and the parameter entry to "- pSTM32F103C8" to set up hardware and software emulation that supports STM32F103C8.
Step 3:
Click to start the simulation, this time there will be an extra toolbar, that is, the Debug toolbar.
1: reset, its function is equivalent to pressing the reset button on hardware, which is equivalent to realizing a hard reset. When the button is pressed, the code executes from scratch again. 2: execute to the breakpoint and press the button to quickly execute to the breakpoint. Sometimes you don't need to watch how each step is executed, but you want to quickly execute to some part of the program to see the result. This button can achieve this function, provided that the breakpoint has been set in the viewing place. 3: stop running, this button becomes valid when the program is running all the time, and can make the program stop and enter the single-step debugging state. 4: execute in, this button is used to implement the function of executing into a function, which is equivalent to executing the past button in the absence of a function. 5: in the past, where you encounter a function, you can step through the function through this button without stepping into the function. 6: when executed, the button enters the single-step debugging of the function, and sometimes it is no longer necessary to execute the rest of the function. Through this button, you can directly execute the rest of the function in one step, and jump out of the function and return to the position where the function was called. 7: execute to the cursor, this button can quickly make the program run to the cursor, similar to the function of the button at the breakpoint. 8: Assembly window, through this button you can view the assembly code, which is very useful for the analysis program. 9: stack local variables window, through this button you can display the Call Stack+Locals window, showing the local variables of the current function and their values, easy to view. 10: viewing window, MDK5 provides 2 viewing windows (drop-down selection). Pressing this button brings up a window showing variables. Enter the variable or expression you want to observe to view its value, which is a commonly used debugging window. 11: memory view window, MDK5 provides four memory view windows, press the button, a memory view window pops up, in which you can enter the memory address you want to view, and then observe the changes of this memory. 12: serial port print window, MDK5 provides 4 serial port print windows. Press this button and a window similar to the serial debugging assistant interface pops up to display the printed content from the serial port. 13: logical analysis window, there are three options under the icon, usually use the first, that is, the logical analysis window. Create some new IO ports through the SETUP button, so you can observe the level changes of these IO and display them in a variety of forms, which is more intuitive. 14: the system view window, the button can provide a variety of peripheral register view window (through the drop-down selection), select the corresponding peripheral can call up the relevant register table of the peripheral, and display the values of these registers, it is easy to check whether the settings are correct.
Second, hardware simulation
Hardware simulation is the program downloaded to the single-chip microcomputer, the simulation, is the actual operation of the program in the single-chip microcomputer.
You need to select the latter option, and then select your own emulator in the drop-down list. Then the following steps are the same as the software simulation.
Note: to use tools such as logic analyzers in logic hardware simulation, turn on "Trace"
The above is what the software simulation and hardware simulation refers to. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.