User`s manual

RX600 & RX200 Series Simple Flash API for RX
R01AN0544EU0250 Rev.2.50 Page 15 of 33
March 4, 2014
In e
2
studio:
This is done in the ‘Debug Configurations’ window which is accessed by selecting your project and clicking ‘Run >>
Debug Configurations’. Select your debug configuration and then select the ‘Debugger’ tab. Now click the ‘Debug Tool
Settings’ tab and locate the ‘Program re-writes internal Program ROM’ and ‘Program re-writes internal Data Flash’
rows. Change the ‘Program re-writes internal Program ROM’ drop down to ‘Yes’ if your application will rewrite ROM.
Change the ‘Program re-writes internal Data Flash’ if your application will rewrite Data Flash.
3.3 ROM Area Boundaries
The RX600 and RX200 Series have some MCUs that have more than one ROM Area. For example, a RX63N with
2MB of ROM has 4 ROM Areas (Area 0, 1, 2, and 3). You are allowed to write over flash blocks that are inside the
same ROM Area, but not over ROM Area boundaries. If you do try to write over a boundary, then the R_FlashWrite()
function will return an error code before performing any write operations stating that this has occurred. In order to
write over a boundary, the user will have to take precautions to make sure and split the write up where the first write
programs up to the boundary and then the second write starts at the boundary.
Which ROM Area is currently selected for programming and erasure is controlled by the FENTRY bits located in the
FENTRYR register. The reason programming cannot go across the boundary is because only one of these bits can be
set at a time. Which bit is set is automatically taken care of when the user calls the R_FlashWrite() function.
3.4 Data Flash BGO Precautions
When using data flash BGO the User ROM, RAM, and external memory can still be accessed. This means that care
should only be taken to make sure that the data flash is not accessed during a data flash operation. This includes
interrupts that may access the data flash.
3.5 ROM BGO Precautions
When using ROM BGO external memory and RAM can still be accessed. Since most users will put their code in ROM,
extra care should be taken compared to performing BGO data flash operations. Since the API code will return before
the ROM operation has finished the code that calls the API function will need to be outside of the User ROM. Another
important issue to be aware of is the relocatable vector table. The vector table by default resides in the User ROM. If
an interrupt occurs during the ROM operation then ROM will be accessed to fetch the interrupt’s starting address and an
error will occur. To fix this situation the user will need to relocate the vector table and any interrupt service routines
that may occur outside of ROM. The user will also need to change the variable vector table’s pointer register (INTB).