Microcontroller programming software is typically dominated by Keil and IAR. When choosing suitable microcontroller programming software, one can base the decision on project requirements. This article focuses on IAR microcontroller programming software, mainly explaining the methods for project debugging using this software. If you have any questions about the content to be discussed, let’s learn together.
1. Open the Project
Run the IAR software, navigate to the demoled\Project directory, and open project.eww;
2. Debugging
1. Set Breakpoints
Click on the statement to set a breakpoint on the left side of the code, or right-click on the statement and select Toggle Breakpoint (Code). A red breakpoint marker will then appear on that statement, as shown below;
· Download and Run
Press Ctrl+D or from the main menu select Project –> DownLoad and Debug to download and run
· Execute to Breakpoint
Press F5 or click the Go button on the toolbar to let the program execute to the breakpoint. The Debug Log window will display information about the breakpoint.
· Clear Breakpoints
Double-click the checked box in the Breakpoint window to enable or disable the breakpoint. Use the main menu Edit > Toggle Breakpoint or right-click to select Toggle Breakpoint to delete the breakpoint directly from the Breakpoint window.
· Debug Execution
(1) Step Over: Press F10, or from the main menu Debug > Step Over, to execute one C statement or assembly instruction without stepping into C functions or assembly subroutines;
(2) Step Into: Press F11, or from the main menu Debug > Step Into, to step into C functions or assembly subroutines;
(3) Step Out: Press Shift+F11, or from the main menu Debug > Step Out, to execute the C function or assembly subroutine from the current position and return to the next statement that called that function or subroutine;
(4) Next Statement: Run directly to the next statement;
(5) Run to Cursor: Run from the current position to the cursor location;
(6) Break: Terminate execution;
(7) Reset: Reset;
(8) Stop Debugging: Exit the debugger;
View Variables (Live Watch Window)
(1) To open the Live Watch window, select View → Live Watch from the main menu. The Live Watch window is used to observe variables at a stationary position, such as global variables.
(2) Right-click the variable you want to observe and click Add to Watch; the variable’s value will change and display during execution.
7. Monitor Registers
Select View > Register from the main menu to open the register window, which displays the CPU registers. You can choose any register group to view from the dropdown menu in the upper left corner of the register window.
8. View Memory
Users can monitor the selected memory area in the memory window.
(1) Select View > Memory from the main menu to open the memory window (displaying data in 8-bit format).
(2) Double-click a global variable name and drag it to the memory window with the mouse. Execute step-by-step while observing how the memory content is modified. Users can modify the contents of memory units in the memory window by placing the insertion point where they want to modify and entering a new value.
9. Pause Program
(1) If you need to reset the application, select Debug > Reset from the main menu or click the Reset button on the toolbar.
(2) If you want to exit C-SPY, select Debug > Stop Debugging, or click the Stop Debugging button on the toolbar.
That concludes the content related to “Microcontroller Programming Software” that I wanted to share. I hope this article helps everyone master the methods for project debugging using IAR microcontroller programming software. Lastly, thank you all for reading this article.
Shanghai Ailei Technology Co., Ltd. specializes in providing IT consulting, IT outsourcing, system integration, and various IT value-added services for enterprises. These value-added services include OFFICE 365 cloud services, Dingjie enterprise ERP management software, cloud backup, enterprise email, wireless coverage, internet behavior management, VPN setup, network security services, INTERNET access, equipment leasing, and IP telephone services.