www.ti.com
How to Use NMPU
469
SPNU563A–March 2018
Submit Documentation Feedback
Copyright © 2018, Texas Instruments Incorporated
System Memory Protection Unit (NMPU)
11.3.2.1 How to Run Internal Diagnostic Mode
In internal diagnostic mode, diagnostic logic inside the NMPU module drives the input of the MPU address
and access permission comparator logic. You can program the address for which comparison needs to be
performed and the type of transaction (read/write and user/privilege). For every write to the
MPUDIAGADDR register, an address and access permission comparison is performed and the results are
stored in MPUERRSTAT and MPUERRADDR registers. ERROR output to ESM will be generated if
ERRENA field in MPUCTRL2 register is set to 0xAh. The following is the recommended sequence for
internal diagnostic mode:
1. User must ensure that no bus transactions from the master are going on while NMPU is in internal
diagnostic mode by disabling bus master access. Please follow the bus master TRM on how to idle the
bus interface. it will be different from one bus master to another.
2. Unlock the MPU registers by writing 0xA to LOCK field of MPULOCK register.
3. Disable memory protection by writing 0x5 to MPUENA key of MPUCTRL1 register.
4. Program the different MPU regions in MPUREGBASE0-7, MPUREGSENA0-7 and MPUREGACR0-7
registers.
5. In MPUDIAGCTRL register, program the INT/EXT bit as 0.
6. Enable the DIAGKEY in MPUDIAGCTRL register by writing 0xA.
7. Program the diagnostic transaction type as read/write in R/W bit in MPUDIAGCTRL register.
User/Privilege mode is set in U/P bit in the same register.
8. Program the diagnostic address in MPUDIAGADDR register.
9. If there should be an access permission violation according to the diagnostic test, error flag is set.
10. Read the MPUERRSTAT and MPUERRADDR registers and verify the expected results.
11. Clear the ERRFLAG bit in MPUERRSTAT register.
12. Repeat steps 6 to 10 for different values of diagnostic address and R/W bit.
13. Exit the diagnostic mode by writing 0x5 to DIAGKEY field in MPUDIAGCTRL register.
14. Lock the MPU registers by writing 0xA to LOCK field of MPULOCK register.
15. User enables bus master. Please follow the bus master TRM on how to enable the bus interface. it will
be different from one bus master to another.