Downloading files to external flash memory
Normally, your application is downloaded to internal memory. To download the main executable file of your project to external flash memory, or any additional images that you have specified using the procedure described in Loading multiple debug images, you must configure C-SPY.
Note
Before following these instructions you must have defined external flash definition files (USD files) for your external flash memory, using the External Flash Definition Editor tool from Renesas Electronics Corporation. For more information, see the documentation from Renesas.
Choose C-SPY driver>Hardware Setup.
On the MCU page of the dialog box, set the Register setting option to either On-chip ROM enabled extended mode or On-chip ROM disabled extended mode.
If you are using external RAM as working RAM, make sure that the Byte order option is set to the same byte order as the CPU.
On the External Memory page of the dialog box, specify up to four external flash definition files (USD files) by typing the absolute paths in the fields or by using the browse buttons. Note that only flash memory with 4096 or fewer sectors can be registered. If flash memory with more sectors is registered, programming cannot be guaranteed.
Decide whether to select the Erase external flash ROM before download options for the specified USD files. If the flash memory is not erased, addresses that are not overwritten by the download will keep their previous contents.
If your flash memory device does not support the Lock command (see the documentation from Renesas), select the Erase external flash ROM before download options for the specified USD files.
If you are allocating a device to multiple CS areas, do not select the Erase external flash ROM before download options for the specified USD files.
Now you are ready to download and debug, see Starting a debug session.
Note
Before downloading images to external flash memory, you must be aware of this:
If the address ranges of multiple specified USD files overlap each other, connection with the hardware debugger cannot be established.
For downloading to external flash memory, only internal RAM or CS area RAM can be used as a work area. SDRAM areas (SDCS) cannot be used as a work area.
The work RAM area can also be used by your application, because the hardware debugger saves and restores data in this area. Note that the work RAM area cannot be specified either as the destination or origin of a DMA or DTC transfer, as an address where a DTC vector table or transfer information is to be allocated, or as the interrupt vector for a DMAC or DTC activation source.
If your flash memory device does not support the Lock command (see the documentation from Renesas), USD files created with the External Flash Definition Editor tool from Renesas should be generated with the option Clear Lock Bit selected on the USD File Creation page.