How to Enable MPU and IPE Segments
320
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Memory Protection Unit (MPU)
{a,IPE_SEGREG(b),IPE_SEGREG(c),IPE_BIP(a,IPE_SEGREG(b),IPE_SEGREG©))}
typedef struct IPE_Init_Structure {
unsigned int MPUIPC0 ;
unsigned int MPUIPB2 ;
unsigned int MPUIPB1 ;
unsigned int MPUCHECK ;
} IPE_Init_Structure;
// this struct should be placed inside IPB1/IPB2 boundaries
// This is the project dependant part
#define IPE_START 0x0D000
// This defines the Start of the IP protected area
#define IPE_END
0x0F000
// This defines the End of the IP protected area
// define borders of protected code
// ipestruct is defined in a adopted linker control file
// ipestruct is the section for protected data;
#pragma RETAIN(ipe_configStructure)
#pragma DATA_SECTION(ipe_configStructure,".ipestruct");
const IPE_Init_Structure ipe_configStructure = IPE_FILLSTRUCT(IPE_MPU IPE_MPUIPENA,
IPE_END,IPE_START);
Table 9-7. IPE_Init_Structure
Field Name
Address
Offset
Length
Description
MPUIPC0
0h
word
Control setting for IP Encapsulation. Value is written to MPUIPC0
MPUIPB2
2h
word
Upper border of IP Encapsulation segment. Value is written to MPUIPSEGB2.
MPUIPB1
4h
word
Lower border of IP Encapsulation segment. Value is written to MPUIPSEGB1.
MPUCHECK
6h
word
Odd bit interleaved parity
NOTE:
Although the user is free to select the location for the IPE Init Structure, protection against
unwanted modification is given only if the structure is placed inside of the protected area
checked by the structure itself. This allows a reconfiguration from within the protected area
but prevents malicious modification from outside.
9.6.2 IP Encapsulation Removal
After successful instantiation of an IP protected memory area, a mass erase erases only the memory area
outside of the IP Encapsulation. To perform an erase of all memory locations in main memory and to
remove the IPE structure pointer, a special erase sequence must be performed. For more details, see the
MSP430 Programming With the JTAG Interface
. For details on how to initiate this erasure from the IDE,
see the
Code Composer Studio for MSP430 User's Guide
NOTE:
An invalid IP Encapsulation init structure or a saved IPE structure pointer with an invalid
target (not pointing to a valid IP Encapsulation init structure) causes an erase of all
nonvolatile memory segments including the IP Encapsulation segments and the init structure
during bootcode execution. This setup error leads to a completely unprogrammed device
after the next bootcode execution. This mechanism ensures that no exposure of IP code can
happen by a misconfiguration or a memory corruption.