
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
107
Revision 1.0, 2011-12-15
2.31
WriteFlashCodeSectorLine()
2.31.1
Description
This function offers the possibility to write one Code Sector (sector 0) flash line. It enables the application program
to modify the code sector, thus enabling code patches or configuration blocks to be applied to the Flash during
application execution.
Some requirements to use this function are mandatory:
•
The code sector must be unlocked
•
The flash-line to be written must be already in erased-state
•
No provision for erasing the Code Sector via ROM library call will be provided
•
The function can not be called in debug mode
This function writes one line (32 bytes) to the Flash Code Sector located at Flash address 4000
H
-- 575F
H
. If the
SP37 is in RUN mode and Lockbyte 2 is not set the write is performed, otherwise this function will return -1. The
line contents are verified after the entire line has been written. In the event that the write verification fails, this
function will return -2.
Note: The application software has to ensure that Flash is only programmed or erased when all required
environmental conditions are fulfilled. Special care has to be taken that ambient temperature
T
FL
, supply
voltage
V
bat
and Endurance E
n
FL
are within specified range (see
Note: Each Flash Code Sector Line may be written only once. Once a line is written with data, it must not be written
again. there is no corresponding ROM function to erase the Flash Code Sector under application program
control.
2.31.2
Actions
Write one Code Sector flash line.
2.31.3
Prototype
signed char
WriteFlashCodeSectorLine
(unsigned int
StartAddress
, unsigned char idata
*WrData
)
2.31.4
Inputs
Table 133
WriteFlashCodeSectorLine: Input Parameters
Register / Address
Type
Name
Description
R6, R7
unsigned int
Startaddress
Must be between 4000
H
and 575F
H
(the line
containing Lockbyte2 is excluding)
Must be multiple of 32
R5
unsigned char
idata*
WrData
Pointer to 32 Byte buffer in RAM holding the
contents to be written to the specified Flash line.