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.

CCS/MSP430F5342: MSP430f5342

Part Number: MSP430F5342

Tool/software: Code Composer Studio

hi,

i want to store 4 different types of arrays in the info B memory of msp430f5342, but every time to write a data i have to erase the info B totally and write the new data according to the example given in family user guide. This way im unable to erase the particular bytes of the info B. 

is there any way to erase the particular data of the info memory or any new approach?

  • Hello,

    Thank you for posting, We'll start to look into this.

    All the best,

    Colin Adema

  • Hello samatha,

    Are you using Driverlib for the MSP430F5xxx devices? The Driverlib has functions that you can use to write to particular segments of the flash. You can find it underneath "software" on the device's webpage.

    See code and attached screenshot below, I created 4 arrays with corresponding data and wrote to each one separately without affecting the others.

    #pragma LOCATION(array_8, 0x1900); //Specify array locations
    #pragma LOCATION(array_8_2, 0x190a);
    #pragma LOCATION(array_16, 0x1914);
    #pragma LOCATION(array_32, 0x1928);

    uint8_t array_8[10] = {}; //Define arrays
    uint8_t array_8_2[10] = {};
    uint16_t array_16[10] = {};
    uint32_t array_32[10] = {};

    uint8_t data_8[5] = {1,2,3,4,5}; //Data
    uint16_t data_16[5] = {1,2,3,4,5};
    uint32_t data_32[5] = {1,2,3,4,5};

    uint8_t *segBstart = &array_8[0]; //Segment B starts

    int main(void)
    {

    WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer

    FlashCtl_eraseSegment(segBstart); //Erase segment B

    FlashCtl_write8(&data_8[0], &array_8[0], 5); //Write first array

    FlashCtl_write8(&data_8[0], &array_8_2[0], 5); //Write second array

    FlashCtl_write16(&data_16[0], &array_16[0], 5); //Write third array

    FlashCtl_write32(&data_32[0], &array_32[0], 5); //Write fourth array


    return 0;


    }

    All the best,

    Colin Adema

  • hi,

    Thank you for the reply!

    Instead of erasing the whole INFO B can i  erase only "array_8" and copy new data to that "array_8" specifically, without  disturbing other data in INFO B

  • You should try downloading an updated version of driverlib in case something got lost in translation. Here's the link to do it

    http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430_Driver_Library/latest/index_FDS.html

    The flash control files in that download should have functions to write to particular spots like I did in my example.

    Let me know if this helped!

    All the best,

    Colin Adema

  • I think the answer is that a single segment is the smallest amount of flash memory that can be erased.  But depending on how large your arrays are, you could save successive versions of them in INFOB, and only erase when INFOB has been filled up.  Or you could do the same with one or more segments of MAIN memory.  But if you need the ability to overwrite individual bytes or words, then an FR part would probably be more appropriate.

  • Hello Samatha,

    I might've misunderstood what you were asking before, my apologies.

    I agree with George, it sounds like one of our FR devices would be more appropriate for your applications. FR devices contain FRAM, which allows for individual byte overwrites.

    All the best,

    Colin Adema

  • Hello Samatha,

    How has the issue been? Has it been resolved?

    All the best,

    Colin Adema