Professional Documents
Culture Documents
Figure 6. Debug
Before running, let’s add a debug breakpoint. Go to the line 28 in main.c, right click on the blue column,
next to the line number, and select Toggle Breakpoint (or just double-click on the blue column). A blue
bubble should appear on the blue column:
Figure 8. Debug breakpoint
In order to start running the program, you can press the green play button (or F8)
The program now should run until line 28, where it stops at the breakpoint:
Look at the board’s green LED. Press F8 again. The green LED should toggle.
Now, right click on the debug breakpoint that was previously placed at line 28, and select Disable
breakpoint. Now, the LED should be blinking at 10Hz.
Press the red button to terminate the program.
Modify the main.c file in order to include a counter variable in the infinite while loop, and add a breakpoint
as in the Figure below:
You should now debug the program, and as you run it with F8, you should see the value of the ctr
expression increasing, in the Expressions tab.
You can also inspect special function registers and how their values change between executions of code
lines.