This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

flash memory addresses g2553

Other Parts Discussed in Thread: MSP430G2553

Hi,

I'm storing two ints in my flash memory starting at address 0x0E000.  I found code online that does that and it works very well.  My only question about is: where am i writing to?  is it main flash memory or one of the information segments?  is it possible to make the address wrong and accidentally overwrite my running code?  I've looked for a memory map but I can't seem to make heads or tails of the ones I've found in datasheets.  

In short: if I were writing, say, 513 Bytes, I would need to use at least two segments of main flash memory.  How do I know which segments I'm allowed to access without killing my code?

A second question:  if my address is 0x0E000 and I want to write a second int right next to it, is the new address 0x0E001 or 0x0E002 (ie: are the addresses for bytes or ints?)

Mike

  • The 2553 have 16K starting at 0xC000 and goes to 0xFFFF
    So 0xE000 is 2/3 up there so it's a bad location unless you need all that space for flash rewriting.

    You can make changes to the Linker file so it will not use your special reserved segment for code
    and it will simple warn that you are running out of memory when compiling.

    If storing data is not a one-time-deal and you need to erase it at times,
    then reserve the last 512bytes that don't include the IRQ vectors.

    If the int is 16bit when you need to +2 for each address step

  • Thanks, that makes sense.  My original post may have been in error, the memory address is 0x0E000, not 0xE000.  Does that matter?

    The next question I have is: If all i want to do is write to segment B of information data, then am I correct in saying that it starts at 0x01100?  I feel it will be smarter to write to information data than to program data anyway since it's only two or three ints.

    Mike

  • Let the compiler figure it it, use RSEG INFOB to specify location.

    Open up your msp specific linker file, this is what IAR adds to project folder: lnk430g2553.xcl

    / Information memory
    //

    -Z(CONST)INFO=1000-10FF
    -Z(CONST)INFOA=10C0-10FF
    -Z(CONST)INFOB=1080-10BF
    -Z(CONST)INFOC=1040-107F
    -Z(CONST)INFOD=1000-103F

  • Hm, neat.  that works very well, thanks.  Out of curiosity, how did you know that these files exist?  I'm a bit in the dark about how everyone else seems to know all about this uC and its features :-P Or does it just come from experience?

    Thanks a lot!

    Mike

  • The msp specific Linker file toke me a year to figure out it was there.

    Always open up the msp430g2553.h file too.
    Knowing what crypting words mean and what other options are available.

    Example: 
    #define DIVM_0              (0x00)   /* MCLK Divider 0: /1 */
    #define DIVM_1              (0x10)   /* MCLK Divider 1: /2 */
    #define DIVM_2              (0x20)   /* MCLK Divider 2: /4 */
    #define DIVM_3              (0x30)   /* MCLK Divider 3: /8 */

    #define SELM_0              (0x00)   /* MCLK Source Select 0: DCOCLK */
    #define SELM_1              (0x40)   /* MCLK Source Select 1: DCOCLK */
    #define SELM_2              (0x80)   /* MCLK Source Select 2: XT2CLK/LFXTCLK */
    #define SELM_3              (0xC0)   /* MCLK Source Select 3: LFXTCLK */

**Attention** This is a public forum