
Flash Development Toolkit
Method for Using the User Program Mode (SH7086 Application)
REJ06J0071-0100 /Rev.1.00 2009.2 Page 96 of 106
(3) Flash memory erase (FDTErase.c)
• EraseInit
Select the user area and after specifying the operating clock frequency, initialize the erase library. For
the operating clock frequency, the operating clock frequency specified by FDT is transmitted to the
device in new bit rate selection. The library initialization uses this operating clock frequency.
/*
////////////////////////
// EraseInit Function //
////////////////////////
*/
BYTE EraseInit(void)
{
InitPtr ERASE_INIT = (InitPtr)INIT_ADDR;
FKEY = WRITE_ERASE_ENABLE;
return ((*ERASE_INIT)(Frequency,0));
}
• EraseStart
After specifying the block number to be erased, call the erase library. The block numbers are received
from the Flash Development Toolkit. For details, refer to the sources of the files for user program mode.
/*
/////////////////////////
// EraseStart Function //
/////////////////////////
*/
BYTE EraseStart(BYTE blk_no)
{
ErasePtr ERASE_BLOCK = (ErasePtr)WRITE_ERASE_ADDR;
return ((*ERASE_BLOCK)(blk_no));
}
INIT_ADDR and WRITE_ERASE_ADDR defined in KDevice.h as follows:
#define TRANS_RAM_ADDR 0xFFFF9000
#define INIT_ADDR (TRANS_RAM_ADDR+32)
#define WRITE_ERASE_ADDR (TRANS_RAM_ADDR+16)
Kommentare zu diesen Handbüchern