E2/E2 Lite
R20UT4582EJ0100 Rev.1.00
Page 22 of 30
Jul.16.19
3.3.2
Notes on a Debugging Operation that Involves Reprogramming of Flash Memory
A “debugging operation that involves reprogramming of flash memory” refers to the following operations of
the emulator debugger.
•
Downloading data to flash memory
•
Using software break functions in flash memory
(a) Setting and canceling breakpoints
(b) Executing or step-executing programs from a breakpoint
(c) Using the “Run to Line” function from the state where a break was set
(1) Program for reprogramming flash memory
Since the emulator debugger enables a debugging operation that involves reprogramming of flash
memory, the emulator writes the program for reprogramming flash memory to the on-chip SRAM and
executes the program to reprogram the flash memory. After the flash memory has been reprogrammed,
the emulator debugger restores the on-chip SRAM to its initial state.
(2) Destination for allocation of the program for reprogramming flash memory
By default, the program for reprogramming flash memory is allocated to the 5-Kbyte space from the
address 2000 8000h in the on-chip SRAM. If the default allocation destination is not available due to the
security settings or DMAC/DTC transfer*, enter the start address of an available space in the on-chip
RAM in units of 1000h bytes against [Work RAM Start Address] under [Flash] on the [Debug Tool
Settings] tabbed page for the emulator debugger (the operation is explained for the case when the e
2
studio is in use).
Note: The DMAC or DTC will continue to operate even during a break. Take care that a transfer source or
destination for the DMAC or DTC is not within the address range of the working RAM where the
program is to be allocated.
Figure 3.6 Setting of [Work RAM Start Address]
(3) Interrupts and resets during execution of the program for reprogramming flash memory
Interrupts other than non-maskable interrupts are to be masked while the program for reprogramming
flash memory is being executed. Also, so that the program for reprogramming flash memory is correctly
executed, all interrupt source flags which have been set before executing the program are cleared.
If a non-maskable interrupt occurs, the emulator continues running the program for reprogramming flash
memory. If a reset occurs while the program for reprogramming flash memory is being executed, the
emulator shows an error message and stops processing. Since doing so may damage the contents of
flash memory, do not apply a reset while the program is running.
(4) Conditions for downloading data to flash memory being available
When the MCU satisfies all the following conditions, the downloading of data to flash memory can
proceed.
(a) The power supply mode of the MCU is the all power supplied mode (ALLPWON).
(b) The power control mode of the MCU is the normal mode (NORMAL).
(c) The code flash memory of the MCU is in read mode.