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.

MSP430f47197 and 120KB flash --- Memory allocation

Other Parts Discussed in Thread: MSP430F47197

As you know or you may not know MSP430F47197 has 120KB flash memory. I have a code that uses flash to do a certain job.

 

I need to save some values into the rest of FLASH but each time I need to pick a random Byte and see if that is already used or not!

 

Is there any specific way to know where in the Flash is unused?

 

FLAHS MEMORY SPECIFICATION:         0FFFF- FFC0

                                                                   1FFFF- 002100

 

p.s. I use IDE IAR

 

 

 

 

  • The map file generated by the Linker will tell you what memory locations are being used.  You usually can assume that the rest of memory are unused.

  • Got it! Thanks OCY!

  • When I only use one byte of the flash as follows.

    void main(void) { WDTCTL = WDTPW + WDTHOLD; P7DIR = 0x00; // Redundant P8OUT = 0; // Before set DIR P8DIR = 0x07; //P8.2=>EN, P8.1=>RW, P8.0=>RS DelayMs(100); // OR USING __delay_cycles() LCD_init(); DelayMs(50);
    LCD_cmd(0x87); read_flash(0xf200); erase_flash(0x0f200); write_flash(1,0x0f200); } the display shows a dummy character and I do a little test and unplug the power and replug it again,
    It shows "1" which is logical and works fine.

    But when I add one byte more and use another byte of the flash it shows one dummy character + number "2". ( as I asked the other cell to shows 2.

    In other words, after power reset only the second flash's byte shows up!

    It is not logical to me!


    Is there any conflict between the bytes of the flash? I even use two far away bytes!

     

     

  • CaEngineer said:
    erase_flash(0x0f200);

    erase_flash does not erase just a single byte at the given address. it will always erase a complete flash segment (you can't erase individual bytes). The size of a flash main segment usually is 512 bytes, so erase_flash(0c0f200) erases all flash from 0x0f200 to 0x0f3ff.

**Attention** This is a public forum