3 TARGET PROGRAM AND DEBUGGING
EPSON S1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
12
3.4 Debugging Method
The following three methods are available for debugging the target program.
1. Debugging in the ROM
Map the target program in the ROM after linking to the debug monitor. The target program can be executed and
debugged in the ROM.
Since the [Source] window of the debugger displays the disassembled content of the ROM on the target system,
it is not necessary to load the target program with the lf command. To display the source, load the same
absolute object file as the one written to the ROM. In this case, by using the ld command instead of the lf
command, the db33, except for the object code, loads only the debugging information.
After starting the debugger, follow the process below before starting to debug:
1. Load the debugging information (when displaying the source or using symbols).
2. Set up a hardware PC break point for the forced break function.
Example: command file example of the above description
ld sample.srf ; Load the debugging information of the target program
bh ESC ; Set up a hardware PC break point at the label ESC (for forced break)*
* For example, an NMI input switch can be used for the forced break function.
Example: NMI processing routine example for forced break function
NMI: ; nmi
nop
.global ESC
ESC: ; Label set as a hardware PC break point for the forced break function
reti
Note:When debugging the target program in the ROM, the software PC break function (bs command)
cannot be used.
2. Debugging in the RAM
Load the target program into the RAM of the target system with the lf command to debug the program in the
RAM.
After starting the debugger, follow the process below before starting to debug:
1. Set the trap table base address (only when placing the trap table in the RAM).
2. Load the target program.
3. Reset the CPU.
4. Set up a hardware PC break point for the forced break function.
The following shows a debug-command file example in which the above process is described.
Example: "dmt33004\sample\led.cmd"
eb 4812d ; Set up TBRP (TTBR write protection register)
59 ; Remove TTBR write protection
q
ew 48134 ; Set up TTBR (trap table base register)
600000 ; Set up the base address to 0x600000 (external RAM)
q
lf led.srf ; Load the target program (0x600000~)
rsth ; Reset the CPU (reset vector at 0x600000 is set to the PC)
bh ESC ; Set up a hardware PC break at the label ESC (for forced break)