SLAU320AJ July 2010 – May 2021
If a device has a Memory Protection Unit (MPU), it must be disabled before erasing or writing memory. The MPU can separate the memory into different parts. Each part can have different access rights such as READ, WRITE, and EXECUTE. A nondisabled MPU could cause a write or erase to be incomplete. Furthermore, the MPU settings, which are stored in a register, could be locked. To disable this register lock, a BOR must be performed. The sequence diagram below shows how to disable the MPU. The example code can be found in the associated zip file in the function DisableMpu430Xv2().
Is MPU enabled (read register at 0x05A0)? | ||||
YES | NO | |||
Are MPU settings locked? | Return | |||
YES | NO | |||
IR_Shift(IR_JMB_EXCHANGE) | :do JTAG mailbox exchange request | Write 0xA500 at address 0x05A0 | :disable MPU | |
DR_Shift16(0x0001) | :configure mailbox to 16-bit mode | Return | :MPU is disabled | |
DR_Shift16(0xA55A) | :send device after BootCode execution into LPM4 | |||
Execute BOR | ||||
Initialize JTAG access (ResetTAP) | ||||
Synchronize JTAG and assert POR | ||||
Write 0xA500 at address 0x05A0 | :disable MPU | |||
Return | :MPU is disabled |