
RM0453 Rev 2
117/1454
RM0453
Embedded Flash memory (FLASH)
153
Arguments:
•
HdpArea
: Input parameter, bitfield that identifies which HDP area to close. Values can
be:
RSSLIB_HDP_AREA1
•
VectorTableAddr
: Input parameter, address of the next vector table to apply. The
vector table format is the one used by the Cortex-M0+ core.
Description:
The user calls
CloseExitHDP()
to close Flash HDP secure memory area and to jump to
the reset handler embedded within the vector table, which address is passed as input
parameter. On successful execution, the function does not return and does not push LR
onto the stack. In case of failure (bad input parameter value), this function returns
RSSLIB_ERROR
.
Example:
Call
CloseExitHDP()
function that closes HDP area and jumps to vector table located at
address 0x8020000.
RSSLIB_PFUNC->CloseExitHDP(RSSLIB_HDP_AREA1, 0x8020000);
4.6
Flash memory protection
The main Flash memory can be protected against external accesses with the readout
protection (RDP). The pages can also be protected against unwanted write (WRP) due to
loss of program counter context. The write protection WRP granularity is 2 Kbytes.
Apart from the RDP and WRP, the Flash memory can also be protected against read and
write from third parties (PCROP). The PCROP granularity is 1 Kbyte.
Part of the Flash main memory can be secured, granting exclusive access to this part of the
memory to CPU2.
4.6.1
Readout protection (RDP)
The readout protection is activated by setting the RDP option byte and performing an option
byte programming with OPTSTRT followed by a OBL_LAUNCH, POR or wakeup from
Standby or Shutdown mode. The readout protection protects the main Flash memory, the
option bytes, the backup registers (TAMP_BKPxR in TAMP) and SRAM2.
There is no exception while the debugger is connected.
There are three levels of readout protection from no protection (level 0) to maximum
protection or no debug (level 2).
The Flash memory is protected when the RDP option byte and its complement contain the
pair of values shown in the table below.
Table 18. Flash memory readout protection status
RDP byte value
RDP complement value
RDP level
0xAA
0x55
Level 0
Any value except 0xAA or 0xCC
Any value (not necessarily
complementary), except 0x55 and 0x33
Level 1 (default)
0xCC
0x33
Level 2