Jump to content
43oh

[FET430UIF] Program directly into RAM


Recommended Posts

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)

Link to post
Share on other sites

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...

Link to post
Share on other sites
  • 5 months later...

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)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...