Example:
unsigned char rd_data[0x800];
int st;
....................
st = F_Memory_Read_Data( 0x1000, 0x800, rd_data );
if ( st != TRUE )
{ .................. }
....................
F_Copy_Buffer_to_Flash
F_Copy_Buffer_to_Flash - Write “size” number of bytes from the Write Data Buffer (see Figure
4.2) to flash. Starting address is specified in the “start address”.
VALID FPA index - ( 1 to 64 ) or 0 (ALL FPAs) executed sequentially.
Syntax:
MSPPRG_API INT_X F_Copy_Buffer_to_Flash( LONG_X start_address,
LONG_X size );
Parameters:
start address - Even number from 0x1000 to 0x1FFFE,
size - Even number
Return value:
1 - TRUE if data has been saved successfully
0 - FALSE.
-2 - FPA_INVALID_NO.
NOTE: Specified address in the Write Data Buffer is the same as a physical
FLASH address.
Note: Function is useful for writing small data block, usually shorter then 200 bytes, like calibration
data, serial numbers etc. Function can also be used to writing longer data block, however for
this purpose it is recommended to use an encapsulated function F_Memory_Write() described
in this manual. The F_Copy_Buffer_to_Flash() (the same as the F_Memory_Write_Data()
function) uses byte by byte flash write procedure. When the JTAG or Spy-Bi-Wire interface
is used, then the F_Copy_Buffer_to_Flash() use the JTAG/SBW protocol to directly
program the Flash memory. The F_Memory_Write() function first download the Flash Loader
to RAM memory, and use the block write flash procedures, speeding up programming
process.
99