beautypg.com

3 debugging procedure – Renesas M30220TF-PRB User Manual

Page 34

background image

( 32 / 54 )

4.3 Debugging Procedure

(1) Debugging Procedure for CPU Rewrite Mode (Microcomputer Mode)

Here following describe the debugging procedure in microcomputer mode. Figure 4.2 shows the
memory map when debugging.

Figure 4.2 Memory map when debugging in microcomputer mode

(4)

(2)

Inside of MCU

(MAP: "EXT")

Emulation memory

(MAP: "INT")

SFR area

RAM area

Boot ROM area

(5)

User ROM area

Unused

(3)

(1)

00000h

00400h

DE000h

E0000h

FFFFFh

Procedure

Description

Downloading the control program for CPU rewrite mode
• You must execute custom command dbg_reset before debugging the control program for

CPU rewrite mode.

• Set the MAP for addresses E0000h to FFFDFh to "INT" (to enable emulation memory).
• Download the control program for CPU rewrite mode to be debugged to emulation memory.
• After downloading the control program, set a breakpoint as indicated below. (See the next

page, Table 4.1 for an example.)
"Stop after jumping to the RAM area, and before setting the CPU rewrite mode select bit to "1"."

Transfer the control program for CPU rewrite mode to the RAM area.
• Running the program transfers the control program for CPU rewrite mode to the RAM area

(emulation memory).

Set the map for user ROM area E0000h to FFFDFh to "EXT".
• Using the breakpoint set in (1), stop program execution after jumping to RAM area, and

before the CPU rewrite mode select bit is set to "1".

• Set the MAP for addresses E0000h to FFFDFh to "EXT" (to enable the evaluation MCU).
• Set a breakpoint as indicated below. (See the next page, Table 4.1 for an example).

"Stop immediately before jumping to user ROM area."

Write to flash memory.
• Flash memory is rewritten to by running the control program. See "4.5 Precautions for CPU

Rewrite Mode" (page 37) for notes.

• Using the breakpoint set in step (3), stop at the end of the control program for CPU rewrite

mode.

Check the contents of MCU's internal flash memory after rewriting.

In step (4), by changing the settings as shown below, you can read the contents of the
MCU's internal flash memory using the script command, dump window and RAM monitor
window. For details on how to access, refer to Section 4.4 (page 36) and the precautions
to Section 4.5 (page 37).

(1)

(2)

(3)

(4)

(5)

Item

Setting

Map of addresses E0000h - FFFDFh

EXT

CPU rewrite mode select bit (FMCR1)

1

Mode of flash memory

Read array mode