Skip to content

Proposal for information memory usage

midluk edited this page Sep 14, 2010 · 7 revisions

Introduction

The cc430 has 4*128B information memory (flash). This memory can not be overwritten by the rfbsl and is also normally not overwritten when using the debug interface (except when using IAR).
The first page D (001800h-00187Fh) holds some calibration data set in the factory and should rather not be touched.
The remaining three memory pages are unused and could be used .

I’m proposing the following usage for the memory, so that it can be used by multiple applications without interference.

Proposed data structure

beginning from address 001880h (or anywhere else on word boundary):

  1. 1 global identifier word (proposal: 0×5A74)
  2. 1 byte: complete amount of application data counted in words (global identifier word, this byte, maximum amount byte and global terminator word not counted)
  3. 1 byte: maximum amount of data counted in words (to prevent data not managed by this structure and following on later addresses from being overwritten)
  4. application data
    1. 1 identifier byte for the application (this has to be exclusive for the applications, should be listed on this page)
    2. 1 byte amount of data words for the application (id byte, this byte and terminator byte not counted)
    3. any amount of data (even byte count, limited by available information memory)
  5. repeat “4.” for other applications
  6. 1 global terminator word (proposal: 0xdaf4)

explanation

Word length is 2 bytes, byte order is little endian (native byte order of msp430).

Functions to read, write, update and delete application data should be written so that an application only sees the data it asks for and does not have to care about the integrity of the overall structure. The terminators word is not strictly necessary but is just for cross checking of data integrity.

Using words instead of single bytes vastly simplifies (and speeds up) memory driver code because it can (almost) always use word access without having to check if the data is aligned on word boundary. The two single bytes for the sizes and the two single bytes for application header and size can be handled together.

recent changes

  • use words instead of bytes for sizes
  • global terminator word instead of byte
  • remove application terminator byte

Identifier byte assignment

  • 0×00-0×0F : reserved
  • 0×10 : sidereal time clock
  • 0×80-0xFF : reserved