-
Notifications
You must be signed in to change notification settings - Fork 94
Proposal for information memory usage
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.
beginning from address 001880h (or anywhere else on word boundary):
- 1 global identifier word (proposal: 0×5A74)
- 1 byte: complete amount of application data counted in words (global identifier word, this byte, maximum amount byte and global terminator word not counted)
- 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)
- application data
- 1 identifier byte for the application (this has to be exclusive for the applications, should be listed on this page)
- 1 byte amount of data words for the application (id byte, this byte and terminator byte not counted)
- any amount of data (even byte count, limited by available information memory)
- repeat “4.” for other applications
- 1 global terminator word (proposal: 0xdaf4)
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.
- use words instead of bytes for sizes
- global terminator word instead of byte
- remove application terminator byte
- 0×00-0×0F : reserved
- 0×10 : sidereal time clock
- 0×80-0xFF : reserved