How to Enable MPU and IPE Segments
319
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Memory Protection Unit (MPU)
9.6.1 IP Encapsulation (IPE) Instantiation Using IPE Signatures
The boot code can preload user-defined setting before the start of application code. This ensures that the
encapsulation is active before any user-controlled accesses to the memory can be performed.
9.6.1.1
IP Encapsulation Signatures
Two IPE signatures, IPE Signature 1 (memory location 0FF88h) and IPE Signature 2 (memory location
0FF8Ah), reside in FRAM and can be used to control the initialization of the IP Encapsulation. Write
0xAAAA to IPE Signature 1 to trigger the evaluation of the IPE Signature 2 as the IPE structure pointer.
The following code for CCS is an example:
#define IPE_SIG_VALID
0xFF88
// IPE signature valid flag
#define IPE_STR_PTR_SRC 0xFF8A
// Source for pointer (nibble address) to MPU IPE structure
#pragma RETAIN(ipe_signalValid)
#pragma location=IPE_SIG_VALID
const unsigned int ipe_signalValid = 0xAAAA;
// Locate your IPE structure and it should be placed
// on the top of the IPE memory. In this example, IPE structure
// is at 0xD000
#pragma RETAIN(IPE_stringPointerSourceSource)
#pragma location=IPE_STR_PTR_SRC
const unsigned int IPE_stringPointerSourceSource = (__INSERT_IPE_STRUCT_ADDRESS_(0xD000)__) >> 4;
Table 9-6. IPE Signatures
Signature
Address
Symbolic Name
Description
IPE Signature 1
0FF88h
IPE_SIG_VALID
IPE signature valid flag
IPE Signature 2
0FF8Ah
IPE_STR_PTR_SRC
Source for pointer (nibble address) to MPU IPE structure
9.6.1.1.1 Trapdoor Mechanism for IP Structure Pointer Transfer
The bootcode performs a sequence to ensure the integrity of the IPE structure pointer. On bootcode
execution, a valid IPE Signature 1 triggers the transfer of the IPE Signature 2 (IPE structure pointer
source) to a secured nonvolatile system data area (saved IPE structure pointer). This transfer only
happens once if no previous secured IPE structure pointer exist. Subsequent of a successful transfer of
the IPE structure pointer, the IPE Signatures can be overwritten by any value without compromising the
existing IP Encapsulation.
NOTE:
Memory locations for IPE Signatures are shared with the JTAG password. This gives the
limitation that the first word of the JTAG password cannot be set to 0AAAAh for a
nonprotected device, because this would unintentionally trigger the trapdoor mechanism.
9.6.1.2
IP Encapsulation Init Structure
By evaluating the saved IPE structure pointer, the bootcode can program the IP Encapsulation related
register by transferring the values defined in the IP Encapsulation init structure to the corresponding fields
in the MPU control registers. The definition of the structure can be seen in
. The check code is
calculated as an odd bit interleaved parity of the previous three words. As an example, see the following
code for CCS:
// IPE data structures definition, reusable for ALL projects
#define IPE_MPUIPLOCK
0x0080
#define IPE_MPUIPENA
0x0040
#define IPE_MPUIPPUC
0x0020
#define IPE_SEGREG(a)
(a >> 4)
#define IPE_BIP(a,b,c) (a ^ b ^ c ^ 0xFFFF)
#define IPE_FILLSTRUCT(a,b,c)