Flash
Description:
This function will make the currently programmed flash protection settings permanent. This is
a non-reversible operation; a chip reset or power cycle will not change the flash protection.
This function will not return until the protection has been saved.
Returns:
Returns 0 on success, or -1 if a hardware error is encountered.
8.2.1.9 ROM_FlashProtectSet
Sets the protection setting for a block of flash.
Prototype:
int32_t
ROM_FlashProtectSet(uint32_t ui32Address,
tFlashProtection eProtect)
ROM Location:
ROM_APITABLE is an array of pointers located at 0x0100.0010.
ROM_FLASHTABLE is an array of pointers located at ROM_APITABLE[7].
ROM_FlashProtectSet is a function pointer located at ROM_FLASHTABLE[5].
Parameters:
ui32Address is the start address of the flash block to be protected.
eProtect is the protection to be applied to the block. Can be one of FlashReadWrite,
FlashReadOnly, or FlashExecuteOnly.
Description:
This function will set the protection for the specified 2 kB block of flash. Blocks which are
read/write can be made read-only or execute-only. Blocks which are read-only can be made
execute-only. Blocks which are execute-only cannot have their protection modified. Attempts
to make the block protection less stringent (that is, read-only to read/write) will result in a failure
(and be prevented by the hardware).
Changes to the flash protection are maintained only until the next reset. This allows the ap-
plication to be executed in the desired flash protection environment to check for inappropri-
ate flash access (via the flash interrupt). To make the flash protection permanent, use the
ROM_FlashProtectSave() function.
Returns:
Returns 0 on success, or -1 if an invalid address or an invalid protection was specified.
8.2.1.10 ROM_FlashUserGet
Gets the user registers.
Prototype:
int32_t
ROM_FlashUserGet(uint32_t
*
pui32User0,
uint32_t
*
pui32User1)
78 April 8, 2013