• Keine Ergebnisse gefunden

Step 32) Check the [2 pass] radio button in the make options select part of the [other options] window, then use the [MAKE] button to execute make

3.3 Debugging Environment

3.3.2 Debug Monitor MON33

The Debug Monitor MON33 is a middleware designed for E0C33 Family single-chip microcomputers. It provides program-debugging functions on the user target board or DMT33xxx boards. By connecting the board in which MON33 has been implemented to the personal computer via the DMT33MON board, the program can be debugged using the Debugger db33. This section explains how to debug the program using the DMT33004/DMT33005 board in which MON33 has been implemented as a development tool.

System configuration and connection

Figure 3.3.2.1 shows the debugging system configuration using the DMT33004/DMT33005 board.

COMx

EPSON

RS232C cable (supplied with DMT33MON package)

DMT33MON DMT33004/DMT33005

1 12

Fig. 3.3.2.1 Debugging system using DMT33004/DMT33005 board Starting up and checking operation

The following sample programs are provided to check the system operation:

For DMT33004 board: "\cc33\sample\dmt33004\led.srf"

"\cc33\sample\dmt33004\led2.srf"

For DMT33005 board: "\cc33\sample\dmt33005\led.srf"

"\cc33\sample\dmt33005\led2.srf"

These programs blink the LED on the DMT board. "led.srf" and "led2.srf" are created to be able to debug in the RAM (0x600000~) and in the Flash memory (0x200000~), respectively.

For the contents of the program, refer to the source file (led.s) in the directory.

It is not necessary to execute Make when modification of the source is not needed since the executable object files ("led.srf," "led2.srf") are provided. When the source is modified, execute Make using the make file provided in the directory.

CHAPTER 3: SOFTWARE DEVELOPMENT PROCEDURES

(1) Starting up the Debug Monitor

The boot routine mapped from address 0xC00000 on the DMT33004/33005 starts the debug monitor when the K63 input port is set to "0" (the [DEBUG] switch of the DMT33MON is set to ON).

Start up the debug monitor following the procedure below after connecting the target system to the personal computer.

Fig. 3.3.2.2 DMT33MON board layout

1) Turn SW3[DEBUG] of the DMT33MON on.

2) Turn the power of the DMT33004/33005 on.

3) Reset the DMT33004/33005

(DMT33MON SW1 [RESET] ON→OFF).

4) Turn the personal computer on and start up Windows.

5) Start up the debugger db33 (start-up method is described later).

Note: When the power of the DMT33004/33005 is turned on while the SW3 [DEBUG] of the DMT33MON is off, the debug monitor does not start up. The DMT33004/33005 sets TTBR at the beginning of the Flash memory (0x200000~), so the program sequence branches to the boot address. In this case, turn the SW3 [DEBUG] on and reset the DMT33004/33005 with the SW1 [RESET] to start up the debug monitor.

(2) Debugging in the RAM

The sample program for debugging in the RAM (0x600000~) of the DMT33004/33005 is "led.srf". When starting up the debugger, specify the debug command file "led.cmd" with the -c option. "led.cmd" sets the trap table address to the start address of the RAM and loads "led.srf" to the RAM.

Operating procedure for starting up the Debugger from the DOS prompt is as follows:

1) Start up the debug monitor as described above.

2) Set "\cc33\sample\dmt33004\" (or "\cc33\sample\dmt33005\") as the current directory.

3) Set a path to db33.exe.

4) Start up the debugger with the following command at the DOS prompt.

C:\cc33\sample\dmt33004\>db33 -mon -b 115200 -p 33104_m.par -c led.cmd The debugger starts in debug monitor mode and is ready to debug "led.srf". For example, the LED on the DMT33004/33005 board will start blinking by executing the g command.

The debug monitor does not support forced break functions such as key break.

To suspend the program execution, "led.cmd" contains a command that sets a breakpoint at the label located in the NMI routine of "led.srf". When the SW2 of the DMT33MON is turned on, a NMI is generated and it suspends the program execution.

(3) Debugging in the Flash memory

The sample program for debugging in the Flash memory (0x200000~) of the DMT33004/33005 is "led2.srf".

To write the sample program to the Flash memory, first load the Flash erase/write routine "am29f800.srf".

Then initialize the Flash memory functions using the fls and fle commands and load the sample program into the Flash memory using the lf command. Refer to the sample debug command file "led2.cmd" for executing procedure.

When starting up the debugger, specify the debug command file "led2.cmd" with the -c option. "led2.cmd"

contains debug commands for loading the Flash erase/write routine, setting the trap table address and loading

"led2.srf" to the Flash memory.

CHAPTER 3: SOFTWARE DEVELOPMENT PROCEDURES

E0C33 FAMILY EPSON 29

Operating procedure for starting up the Debugger from the DOS prompt is as follows:

1) Start up the debug monitor as described above.

2) Set "\cc33\sample\dmt33004\" (or "\cc33\sample\dmt33005\") as the current directory.

3) Set a path to db33.exe.

4) Start up the debugger with the following command at the DOS prompt.

C:\cc33\sample\dmt33004\>db33 -mon -b 115200 -p 33104_m.par -c led2.cmd The debugger starts in debug monitor mode and is ready to debug "led2.srf". For example, the LED on the DMT33004/33005 board will start blinking by executing the g command.

The debug monitor does not support forced break functions such as key break.

When the SW2 of the DMT33MON is turned on, a NMI is generated and it suspends the program execution forcibly.

After writing the program to the Flash memory, it can be executed by the DMT33004/33005 alone.

1) Terminate the Debugger.

2) Turn the system power off and then disconnect the RS232C cable.

3) Turn SW3 [DEBUG] of the DMT33MON off and then turn the DMT33004/33005 on.

The "led2.srf" program will be executed in the Flash memory and the LED will start blinking.

(4) Executing from wb33

1) Start up the debug monitor as described above.

2) Start up wb33 and then select the parameter file "\cc33\sample\dmt33004\33104_m.par"

(or "\cc33\sample\dmt33005\33104_m.par") on the execution window.

3) Select DB33 options on the [Other options] windows.

MON, 115200 bps, command file "led.cmd" or "led2.cmd"

4) Start up the Debugger using the [DB33] button.

This procedure starts debugging the same as in items (2) and (3) above.

Precautions

When debugging the user program on the DMT33004/33005 board, observe the precautions described below.

(1) The debug monitor on the DMT33004 has been implemented by linking with the "mon33ch1.lib". Therefore, the built-in serial interface Ch.1 cannot be used from the user program.

The debug monitor on the DMT33005 has been implemented by linking with the "mon33ch0.lib". Therefore, the built-in serial interface Ch.0 cannot be used from the user program.

(2) Forced break functions cannot be used in the Debug Monitor. A forced break function can be realized by setting a hardware PC break point at a label position in the NMI or key input interrupt routine of the target program.

Furthermore, other debugging functions are also restricted. Refer to Chapter 16, "Debugger", for the functions and commands that are supported by the Debug Monitor.

(3) The downloading speed is approx. 8KB/S for RAM and approx. 7KB/S for Flash memory. However, it varies according to the PC used and operating conditions.

(4) The program to be debugged should be created so that it can be loaded and executed in the free area of the RAM or the Flash memory on the DMT33004/33005. The program load address must be specified when linking since it cannot be specified by the Debugger.

The MON33 uses 0 to 0x2F of the internal RAM and 0x6FF640 to 0x6FFFFF in the external SRAM. Be aware that the MON33 will not be able to work if the area above is rewritten. Furthermore, this precaution applies when rewriting the memory using a memory operation command.

CHAPTER 3: SOFTWARE DEVELOPMENT PROCEDURES

CPU: E0C33A104(DMT33004)/E0C33208(DMT33005)

0xC1FFFF External ROM

128KB 0xC021FF Boot routine

0xC00000 0xC00000 MON33 library

0x6FFFFF External RAM

1MB

0x6FFFFF

0x6FF640 MON33 work area 0x600000

0x6FF63F 0x600000 Free area

0x2FFFFF Flash memory 0x2FFFFF

1MB Free area

0x200000 0x200000

0x04FFFF Built-in I/O 0x04FFFF

Control registers of built-in I/O

0x040000 0x040000

0x001FFF Built-in RAM

DMT33005: 8KB

0x000010 Reserved area for MON33 0x00000C R0 stack area

0x000008 PC stack area

0x000000 0x000000 Debugging vector

Fig. 3.3.2.3 DMT33004/33005 memory map

(5) Refer to the "E0C33 Family MON33 Debug Monitor Manual" for more information on the Debug Monitor.