MPU Violations
318
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Memory Protection Unit (MPU)
9.4
MPU Violations
9.4.1 Interrupt Vector Table and Reset Vector
The interrupt vector table and the reset vector are located at addresses 0FF80h to 0FFFFh. It is possible
to define a segment that includes this address space with restricted access rights. If an interrupt or a reset
occurs, and this segment is read protected, the MPU automatically allows access to the Interrupt Vector
memory space 0FF80h to 0FFFFh. Write rights are granted depending on MPU segment access
management register MPUSAM. Only the interrupt vector table is read accessible. Access to the interrupt
routine itself is not automatically enabled.
If the interrupt vector table is inside of the IP Encapsulation, the execute right is always prohibited. Code
fetches at the addresses 0FF80h to 0FFFFh are always denied if IPE-segments include that memory
range.
shows the access right to the interrupt vector table for all possible cases.
(1)
O = Allowed, X = Not allowed, C = Depends on MPU segment access management register MPUSAM
Table 9-5. Access Rights to IVT
(1)
Condition
Read
Execute
Write
IVT belongs to ...
CPU
DMA
JTAG
CPU
CPU
DMA
JTAG
an MPU segment (main memory segment)
O
O
O
O
C
C
C
the IPE-segment
O
O
O
X
O
O
O
an MPU segment and the IPE-segment
O
O
O
X
C
C
C
NOTE:
Only the interrupt table and the reset vector are opened on an interrupt or reset occurrence.
If the application protects the segment that contains the interrupt routine itself from execution
rights, a violation occurs.
9.4.2 Violation Handling
The handling of access rights violations can be selected for each segment with the MPUSEGxVS bit in the
MPUSAM register. By default (MPUSEGxVS = 0), any access right violation causes a nonmaskable
interrupt (NMI). Setting MPUSEGxVS = 1, causes a PUC to occur. In either case, the illegal instruction on
a protected memory segment is not executed. Upon an access rights violation, the data bus content
(MDB) is driven with 03FFFh until next valid data is available.
9.5
MPU Lock
The MPU registers can be protected from write access by setting the MPULOCK bit. Write access is not
possible on all MPU registers except MPUCTL1, MPUIPC0, and MPUIPSEGBx until a BOR occurs.
MPULOCK cannot be cleared manually.
MPUIPLOCK allows to separately lock the MPUIPC0 and MPUIPSEGBx registers. Write access is not
possible on these registers until a BOR occurs. MPUIPLOCK cannot be cleared manually.
9.6
How to Enable MPU and IPE Segments
Both MPU and IPE-segments can be enabled at any time through the control registers. However, in typical
applications, it may be required to initiate MPU segments or the IPE-segment before beginning the
application program, thus the following features are offered as more secure and convenient methods.
1. Code Composer Studio for MSP430 offers an easy-to-use graphical interface to configure MPU
segments and the IPE-segment. See the
Code Composer Studio for MSP430 User's Guide
. When
using the methods outlined in the document, no further user setup is required.
2. For the IPE-segment, when using the method described in the
Code Composer Studio for MSP430
, the compiler and linker handle the structure generation and initialization automatically -
describes what happens behind the scenes in this case, and further user setup is not
required.