4.5.1. Breakpoint example part 1

If RealView MDK is currently displaying a disassembled source view, open the source code for Main.c by clicking on the Main.c tab at the bottom of the source window. If there is no tab for Main.c, open the file from the Project Workspace.

Set a breakpoint on the while(1) statement in the main() function by double-clicking in the left margin beside the line. A red breakpoint appears, indicating that execution of the program stops here.

Select Debug → Run.

Note

The LEDs on the Cyclone III Starter Board are flashing. This is because the breakpoint has not been reached and code is still executing.

There is a loop inside the userIOTest() statement, just above while(1), that is waiting for user input. Press one of the four user switches on the Cyclone III Starter Board and hold it down until the LEDs stop flashing.

In the RealView MDK window, execution has stopped at the breakpoint as shown in Figure 4.10.

Figure 4.10. Program break at while(1) loop

Program break at while(1) loop

Copyright © 2008 ARM Limited. All rights reserved.ARM DUI 0430A
Non-Confidential