English
Language : 

R0E417250MCU00 Datasheet, PDF (193/228 Pages) Renesas Technology Corp – E100 Emulator MCU Unit for H8SX/1700 Series
R0E417250MCU00 User’s Manual
5. Debugging Functions
5.14.5 Detecting Stack Access Violations
Setting the size of the stack too small in software development raises the possibility of a program going out of control or
malfunctioning. The E100 emulator actively detects abnormal access by the stack pointer.
(1) Setting stack areas
Selecting a stack section automatically assigns the addresses of the section as a stack area. Alternatively, you can enter any
desired address range. Up to 4 stack areas can be specified.
(2) Initial settings when the emulator is booted up
At the time the emulator is booted up, the default section (‘s’) is automatically selected. However, automatic selection does not
proceed until a program is downloaded, because there is no address information before this.
(3) Detection method
The emulator monitors the value of ER7 and detects if the value points to a location outside the stack areas.
ER7 value ->
Up to 4 stack ->
areas
Detection circuit
<Compare>
Whether the value of ER7 points ->
outside the stack areas
Error
detected
Figure 5.116 Outline of detection of a stack access violation
The emulator will detect the error if the value of the stack pointer is beyond the stack areas on
1. generation of an interrupt or return from an interrupt handler;
2. calling of a function or return from a function; or
3. the stack pointer pointing to a location outside reserved stack areas.
CAUTION
Detection does not cover cases of corruption of data within a stack area.
(4) Actions taken when a stack access violation is detected
The following actions are selectable.
- Display a warning.
When the Stack Access Violation checkbox has been selected on the Exception Warning page of the Configuration properties
dialog box, you will see a warning in the Status window and in a status bar balloon when errors of this type occur.
- Make the detection of a stack access violation a condition of a hardware breakpoint.
- Make the detection of a stack access violation a condition of a trace point.
REJ10J1831-0200 Rev.2.00 Jun.1, 2009
Page 193 of 228