SPRUJF2A March 2026 – March 2026 AM13E23019
The FPC is also responsible for managing the Hide Protection (HDP) function. The HDP function allows an application to execute a section of code one time, and prevent subsequent read or execute access to the code. As an example, this is useful feature especially when running a second stage authentication code allowing main application to be validated before execution and prevent access to any stored symmetric or private keys.
As shown in Figure 8-5, the HDPSTART and HDPEND fields in the FPC_HDPPROTx_CONFIG register define the start and end sector address which are to be hide protected.
The Table 8-3 shows the valid configuration of values that define the sectors that can be hide protected.
| RULE | COMMENT |
|---|---|
| HDPSTART = HDPEND | Hide protection for exactly 1 sector identified by HDPSTART |
| HDPSTART < HDPEND | Hide protection for sectors from HDPSTART to HDPEND (inclusive) |
| HDPSTART > HDPEND | Invalid configuration defined, no hide protection |
In addition to start and end sector address for HDP, there are two additional registers. The FPC_HDPPROT_CONTROL is used to validate the corresponding configuration register to be active. The FPC_HDPEN_CONTROL is to trigger the mechanism for hide protection. As shown in Figure 8-6, once the start sector, end sector and valid control bits are configured correctly, the HDP is ready. When CPU executes the HDP region code, the HDP is armed. Any function call or jump outside of the HDP automatically enables the mechanism, preventing the application code from re-entering the HDP region. An access, execute or read, generates an NMI.
All the HDP registers are writeable once and can be set by the application code. A system reset does not allow the application to re-configure, therefore a BOOTRST is required.