Apr30 2 Posted May 1, 2012 Share Posted May 1, 2012 Hi, I tend to reprogram my uC even after minor code changes (because I'm new to msp430). When reprogramming the device dozen times per day I'm afraid of exceeding the max number of flash r/w cycles to soon. Is there a way to write the assembled code directly into RAM? (I'm using mspdebug for flash programming) Quote Link to post Share on other sites
TomKraut 17 Posted May 1, 2012 Share Posted May 1, 2012 Like most small Apr30 1 Quote Link to post Share on other sites
rockets4kids 204 Posted May 1, 2012 Share Posted May 1, 2012 Actually, unlike most small microcontrollers, the msp430 has a von Neumann architecture so it *can* execute code from RAM. All you need to do is program the FLASH to read code over the serial port, store it in RAM, and then execute it. That said, the 10K flash cycle is a minimum, and in practice you will be able to get much more. If the MSP430 flash cells are anything like those used on the AVR, you may get a full order of magnitude more. The folks over at DP wrote some code to re-program the AVR's flash memory continuously, and it took several months to wear out the flash cells. Has anyone ever attempted something similar with the msp430? If not, I think I may sacrifice one of my G2211's for this... Apr30 1 Quote Link to post Share on other sites
Apr30 2 Posted October 31, 2012 Author Share Posted October 31, 2012 Thanks for the input. It seems to be possible to do so by using 'org START-OF-RAM' in assembly and writing the compiled binary into RAM using mspdebug. In short: - use 'prog BINARY_NAME' to be able to initialize ISR addresses (because these are in flash memory) - subsequent reprogramming can be done by 'load BINARY_NAME' if you didn't change any of the ISR addresses - make sure your code fits into RAM (there's no warning from mspdebug) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.