FXTH87xx11 and FXTH87xx12 Embedded Firmware User Guide, Rev. 2.1
42
Freescale Semiconductor, Inc.
Firmware Functions
3.2.44
UINT8 TPMS_FLASH_PROTECTION(UINT8 u8Range, UINT16
u16Key)
•
Description:
This function enables flash protection for a custom memory block. After its
execution, both TPMS_FLASH_WRITE and TPMS_FLASH_ERASE will be unable to perform
any operation in the protected blocks, but shall be operational in unprotected areas.
•
Stack size:
11 bytes
•
Approx. Duration:
736 usec if protecting; 20.4 usec for a failed attempt.
•
Power Management:
This function executes entirely in RUN mode.
•
Interrupt Management:
This function does not await any interrupts. It will be affected by
interrupts.
•
Resources:
Global RAM locations $0090 - $00CA.
•
Input Parameters:
— UINT8 u8Range: Byte determining the first address of protection, using the Freescale FPROT
convention. Refer to product spec for a description of this register.
— UINT16 u16Key: Due to the irreversible status after the execution of this routine, this argument
is used as a fail-safe to guarantee desired execution of the function. Only when u16Key is equal
to the least-significant word of the UniqueID will this function execute successfully.
•
Returns
: UINT8 u8Status: according to table below.
WARNING
This routine can only be executed once. After successful execution of this
routine, TPMS_FLASH_WRITE and TPMS_FLASH_ERASE will be
permanently disabled.
Table 29. Possible status values for TPMS_FLASH_PROTECTION
Return Value
Description
$0
u16Key matches lower 16-bits of UniqueID; protection was disabled and now is enabled.
$1
u16Key does not match lower 16-bits of UniqueID; protection was disabled and continues to be so.
$2
u16Key matches lower 16-bits of UniqueID; protection was already enabled.
$3
u16Key does not match lower 16-bits of UniqueID; protection was already enabled.
$4
u16Key matches lower 16-bits of UniqueID; protection was disabled and continues to be so (Failed
writing protection).
$5 - $FF
Reserved.