English
Language : 

SH7059 Datasheet, PDF (859/1042 Pages) Renesas Technology Corp – 32-Bit RISC Microcomputer
25.8 Usage Notes
25. ROM (SH7059)
25.8.1 Switching between User MAT and User Boot MAT
It is possible to switch between the user MAT and user boot MAT. However, the following procedure is required because
these MATs are allocated to address 0.
(Switching to the user boot MAT disables programming and erasing. Programming of the user boot MAT must take place
in boot mode or programmer mode.)
(1) MAT switching by FMATS should always be executed from the on-chip RAM. The SH microcomputer prefetches
execution instructions. Therefore, a switchover during program execution in the user MAT causes an instruction code
in the user MAT to be prefetched or an instruction in the newly selected user boot MAT to be prefetched, thus
resulting in unstable operation.
(2) To ensure that the MAT that has been switched to is accessible, execute eight NOP instructions in on-chip RAM
immediately after writing to FMATS of on-chip RAM (this prevents access to the flash memory during MAT
switching).
(3) If an interrupt occurs during switching, there is no guarantee of which memory MAT is being accessed.
Always mask the maskable interrupts before switching MATs. In addition, configuring the system so that NMI
interrupts do not occur during MAT switching is recommended.
(4) After the MATs have been switched, take care because the interrupt vector table will also have been switched.
If the same interrupt processings are to be executed before and after MAT switching or interrupt requests cannot be
disabled, transfer the interrupt processing routine to on-chip RAM, and use the VBR setting to place the interrupt
vector table in on chip RAM. In this case, make sure the VBR setting change does not conflict with the interrupt
occurrence.
(5) Memory sizes of the user MAT and user boot MAT are different. When accessing the user boot MAT, do not access
addresses exceeding the 12-Kbyte memory space. If access goes beyond the 12-Kbyte space, the values read are
undefined.
<User MAT>
<On-chip RAM>
Procedure for
switching to the
user boot MAT
Procedure for
switching to
the user MAT
<User boot MAT>
Procedure for switching to the user boot MAT
(1) Mask interrupts.
(2) Write H'AA to FMATS.
(3) Execute eight NOP instructions before
accessing the user boot MAT.
Procedure for switching to the user MAT
(1) Mask interrupts.
(2) Write a value other than H'AA to FMATS.
(3) Execute eight NOP instructions before accessing
the user MAT.
Figure 25.20 Switching between User MAT and User Boot MAT
Rev.3.00 Mar. 12, 2008 Page 769 of 948
REJ09B0177-0300