Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: MSP430 disabling the MPU

$
0
0
I am using an FR6989 and I configure the MPU at power-up to prevent writes into code space and to execution from data space. This project requires that I allow upgrades through a serial port. I accept the SREC file via the serial port, and write it to an external flash via I2C. Once that is done, I copy a section of code to ram and execute it. This code copies the new code from the external flash to its run-time location in FRAM, then I reboot the processor to start running the updated code. This all worked fine until I started to use the MPU. As I mentioned, I configure and enable the MPU at power-up, then I disable the MPU just before jumping to RAM to do the upgrade. But it seems as though the MPU doesn't get disabled, or it does get disabled, but my code doesn't run. I am assuming that there is some procedure that I need to follow, that I haven't figured out yet. I have found several articles on how to configure the MPU, but nothing about disabling it. I have tried several things but here is the last thing I tried: MPUCTL0 = MPUPW; // First, write Password bit to access MPU registers and dissable the MPU // Make every section unprotected (just in case I need to do this for the new code to run) MPUSAM = (MPUSEG1WE | MPUSEG2WE | MPUSEG3WE | MPUSEG1RE | MPUSEG2RE | MPUSEG3RE | MPUSEG1XE | MPUSEG2XE | MPUSEG3XE); I also tried locking the MPU and re-starting the MPU after the above, but that seems to make matters worse.

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>