AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 11

no-image

AN2504

Manufacturer Part Number
AN2504
Description
On-Chip FLASH Programming API for CodeWarrior Software
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
VerifyRange and
ReadRange
ErasePage
MOTOROLA
On-Chip FLASH Programming API for CodeWarrior Software
VerifyRange and ReadRange are names for the same function that either
verifies a range of FLASH memory against data in RAM or reads a range of
FLASH memory. When using this function, choose the name that most
accurately describes the purpose of the function.
This function compares a range of FLASH memory against a range (the same
length) of RAM. When FLASH data does not match RAM data, the RAM data
is replaced with FLASH data. If all bytes compared are equal then SUCCESS
is returned; otherwise FAIL is returned. This function also returns the checksum
of the data read. (The checksum is the LSB of the sum of all bytes in the entire
data collection.)
ErasePage erases a page of FLASH. The length of a page depends on the
MCU. In most cases a page is 32 bytes long; however, on the
MCU68HC908JL3/JK3 a page is 64 bytes long.
Freescale Semiconductor, Inc.
Entry Conditions
Entry Conditions
Exit Conditions
Exit Conditions
For More Information On This Product,
Return value
Return value
Parameters
Parameters
Prototype
Prototype
Remarks
Remarks
Go to: www.freescale.com
Table 10. VerifyRange andReadRange
_ini: the absolute address of the first location in FLASH
_num: number of bytes to read/verify
DATA contains the data to be verified
DATA is overwritten with contents of FLASH
The checksum is stored in _ini;
SUCCESS or FAIL
_num must be less than or equal to 64
_page: the absolute address of any of the locations
None
Interrupts are disabled.
None
All bytes within that PAGE will be driven to 0xFF.
to start reading/verifying
within the PAGE to be erased.
Table 11. ErasePage
Byte VerifyRange (Word *_ini, Byte _num)
Byte ReadRange (Word *_ini, Byte _num)
void ErasePage (Word *_page)
FLASH-Programming API
AN2504/D
11

Related parts for AN2504