Grant Edwards schrieb:
On 2006-11-27, David Pettit <[email protected]> wrote:

I want to separate the information memory into section A and B
and write a separate set of data to each section.  What's the
best way to do this?  If I use the union/structure approach
and define two 128 byte long structures, when I force an erase
will it erase just the one section or will it erase both?

yes you can define a "const struct" and place it in the segment ".infomemnobits" (or ".infomem" if you want to download the contents with your firmware file)

erasing and programming needs special care and can not be done with a simple assignment (well when the flash controller is in write mode, you can write this way, but most of the time it's the erase that is problematic. only entire pages can be erased)

the mspgcc library contains function to erase or write flash (à la memcpy)

>From the users guide for some-part-or-other:

  MSP430 flash memory is in-system programmable (ISP) without the
  need for additional external voltage. The CPU can program its
  own flash memory. The flash memory write/erase modes are
  selected with the BLKWRT, WRT, MERAS, and ERASE bits and are:

   - Byte/word write
   - Block write
   - Segment Erase
   - Mass Erase (all main memory segments)
   - All Erase (all segments)

AFAIK, the flash controller is the same in all current parts.

basically yes, but the page sizes of the information memory is different in some parts:

F1xx and F4xx: 128 bytes -> one needs two separate writes to erase both
   pages individually.

F2xx: 64 bytes -> 3 writes for the 3 unprotected pages, an other one
   after unlocking the fourth segment.

chris

Reply via email to