How to Use NMPU
470
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
System Memory Protection Unit (NMPU)
11.3.2.2 How to Run External Diagnostic Mode
In external diagnostic mode, the actual bus master initiates the memory transaction. Address from the bus
master is replaced by the address in MPUDIAGADDR register before the address reaches the address
comparator logic. In this mode, both bus error response and ERROR pulse to ESM (if ERRENA field of
MPUCTRL2 register is set to 0xAh) are generated for accesses that violate the access permissions. This
mode is useful for a complete signal chain testing from bus master internal bus generation logic to NMPU
comparator logics. The following is the recommended sequence for external diagnostic mode:
1. User must ensure that no bus transactions from the master are going on while NMPU is configuring in
external 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 field 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 1.
6. Enable the DIAGKEY field of MPUDIAGCTRL register by writing 0xA.
7. Program the diagnostic address in MPUDIAGADDR register.
8. Enable memory protection by writing 0xA to MPUENA field of MPUCTRL1 register.
9. 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.
10. Initiate ONE bus transactions using the actual bus master.
11. Read the MPUERRSTAT and MPUERRADDR registers and verify the expected results.
12. Clear the ERRFLAG bit in MPUERRSTAT register.
13. Repeat steps 7,10, 11, 12 for different values of diagnostic address.
14. Disable memory protection by writing 0x5 to MPUENA field of MPUCTRL1 register.
15. Exit the diagnostic mode by writing 0x5 to DIAGKEY field in MPUDIAGCTRL register.
16. Lock the MPU registers by writing 0xA to LOCK field of MPULOCK register.
17. Restart the bus master functional operation. Please follow the bus master TRM on how to enable the
bus interface. it will be different from one bus master to another.