How to disable the Flash Access Window for Chip Erase
Background
If the flash access window is set, you need to disable the setting in advance to erase the flash memory set outside the flash access window. Otherwise, you cannot erase all of flash memories.
How to make a source code to disable the flash access window
Create the following source code to disable the flash access window and save it as src file.
.SECTION C, ROMDATA
.ORG 0FE7F5D64H ; The address of the Flash Access Window Setting Register (FAW)
.LWORD 0FFFFFFFFH ; The value of FAW to disable the flash access window
.END
The address of the RX671's FAW register is shown above. The address of FAW register should be changed according to the RX microcontroller used.
How to build the src file to generate the mot file
Build the src file created above with CC-RX compiler to generate a mot file. The src file is in a folder of “c:\example” in this case. Run the command prompt and execute the commands below.
c:\example>set PATH=%PATH%;"C:\Program Files (x86)\Renesas\RX\3_6_0\bin"
c:\example>ccrx -isa=rxv3 -output=sty=xxx.mot xxx.src
note : xxx is an arbitrary file name.
The first command sets the CC-RX path according to your environment. The second command builds the src file and generates the mot file.
How to disable the flash access window using the mot file
How to disable the flash access window is shown below.
Start Renesas Flash Programmer.
Click the [File] tab.
Click [New Project], and then create a dual mode project.
Enter any project name in the [Project Name:] text box.
Change other settings according to the system.
Click [Connect].
In the [ID Code:] text box, enter the set security ID.
Click [OK].
Click the [Operation Settings] tab.
For [Command], select the [Program] and [Verify] check boxes.
Open the [Operation] tab, and add the mot file.
Click [Start].
When "Operation completed." appears, processing is complete.
How to erase all of flash memories and option-setting memory after disabling the flash access window
How to erase all of flash memories and option-setting memory is shown below.
Start Renesas Flash Programmer.
Click the [File] tab.
Click [New Project], and then create a dual mode project.
Enter any project name in the [Project Name:] text box.
Change other settings according to the system.
Click [Connect].
In the [ID Code:] text box, enter the set security ID.
Click [OK].
Click the [Operation Settings] tab.
For [Command], select the [Erase] check box only.
For [Erase Options], select [Erase Chip].
Open the [Operation] tab, and then click [Start].
When "Operation completed." appears, processing is complete.