Keil™, An ARM® Company

FlashMon51 User's Guide

Preliminary

Debugging Programs

There are several buttons on the toolbar you may use when debugging programs using FlashMon51.

ButtonDescription
Debug ButtonWhen you start the debug session, the µVision debugger connects to the target board and downloads the application program. In the event of a communication failure, µVision presents a dialog that displays options and instructions.
Step Into Button
Breakpoints Button
Run Button
FlashMon51 supports most µVision debugger features. You may single-step through code, set breakpoints, and run your application. Variables may be viewed using standard debugger features.
Serial Window ButtonFlashMon51 can share the serial interface, used for monitor communication, with the target program. Serial Window #1 shows the printf and putchar output from the target program.

Note

  • Do not initialize the serial interface in your user application. The monitor configures the UART. Subsequent configuration changes may cause the monitor to lose synchronization with the debugger. You may use conditional compilation as shown in the example programs.
  • It is impossible to single-step through putchar or getkey I/O functions.
Stop ButtonIf the Serial Interrupt option is enabled you may stop program execution using the Halt command from the Debug menu or toolbar or by pressing the Esc key in the Output Window.

The Monitor uses the serial interrupt to halt the user program. If the Monitor cannot stop your program (because the user application has disabled interrupts) a dialog opens that displays options and instructions.
Reset ButtonThe µVision Reset command sets the program counter to 0. However, peripherals and SFRs are not reset. This command is not identical to a hardware reset of the MCU.