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.

MSP430I2040: Which segment to use to store some non volatile energy values.

Part Number: MSP430I2040

Hi,

I need to store the KWHr data in Flash. I don;t think I should use the INFO segment in flash as it stores the calibration values, TLV values etc.

Instead I plan to use the main Flash memory segment.

I checked the MAP file:

1. The flash segment starts at 0x00c000, length is 0x003fdc, unused is 0x0091a( i.e; 2330 bytes).

2. From above it seems that  0x00f6c2 onwards till 0x00ffdc is free.

So can I use the 0x00F7DC and 0x00FFBC flash segments of 1KB each. Please let me know if this is fine. Thanks.

regards,

Rajkumar

  • Hi Rajkumar

    You can store the parameter in main flash. but, please note Information memory has the dedicated write protection. So. the code is not protected during parameter write or segment erase in the main flash.

    So, I recommend store the parameter in the information memory. it is helpful on code safety.

    Please refer to Chapter 5 Flash Memory Controller (FCTL) on MSP430i2xx Family User's Guide (Rev. A)

    Thanks!

  • Hi Xiaodong,

    I understand. But it is difficult to find out which part of the INFO segment is free. Is there any way to be sure?


    Also, since the INFO segment is a 1KB space, any erase issued to the INFO segment will erase all the calibration values stored in it which can be lost if there is a CPU reset that happens before all values are written back to flash.

    If so, can you tell me if the address I chose in main Flash is fine for writing to.

    regards,

    Rajkumar

  • Hi Rajkumar

    >> But it is difficult to find out which part of the INFO segment is free. Is there any way to be sure?

    After user code is ready, build success, you can check the user code address on *.map file

    >> any erase issued to the INFO segment will erase all the calibration values stored in it which can be lost if there is a CPU reset that happens before all values are written back to flash

    I agree with you.

    Thanks!

  • Hi Xiaodong,

    Because of the INFO segment limitations I tried using main flash segment 0xf800 and write some values to it. But after reset the values all read as 0xff s. Is there something wrong I am doing?

  • Hi Rajkumar

    0xf800 is on the range of flash if i20x1 (32KB device) is selected

    Please read and check if this address has been programmed correctly (by MCU code) before MCU power reset.

    Thanks!

**Attention** This is a public forum