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.

Code Composer 6 - driverlib + Flash read

Other Parts Discussed in Thread: MSP430I2041

Hi all,

I just started trying out the Code Composer ... had a look into the samples using the driverlib.

There is a bunch of routines writing to flash segments from code, erasing, fine, but I did not find any flash segment reading functions ?

Did I miss something here ?

Thank, Jens

  • jens kapmeyer said:

    I did not find any flash segment reading functions? Did I miss something here ?

    As you point out, the Driver Library contains functions for erasing and writing to Flash memory, but not for reading. This is because it is easy to read Flash memory - read from it as you would from an internal SRAM location. Conversely, erasing and writing to Flash memory requires a very specific sequence of operations (as outlined in the device user's guide). 

    In most cases, Flash memory is used for program code and thus we don't need to write directly to it. Occasionally, though, you may want to store a 'persistent' variable in Flash memory, so this would require you to erase and then write to Flash (following the prescribed sequence). The Driver Library functions make it easy to perform the erase and write of the non-volatile Flash memory. You can find examples of this in the Driver Library; it is also covered in the "Non-Volatile Memory" chapter of the MSP Design Workshop.

    A couple of side notes:

    • TI's FRAM microcontrollers are an excellent alternative if your application requires persistent data. Like Flash, this type of memory provides non-volatile storage - that is, it holds its value even when power is removed from the device. But, unlike Flash, you can read and write FRAM just like SRAM - no erase cycles are needed. Likewise, FRAM write take very little power and latency. FRAM also has an extremely high number of rewrite cycles.
        
    • In the future, you may want to include the device or LaunchPad you are working with. In this case, the answer generally applies to DriverLib support of Flash based devices, but this may not always be the case.

    Hope this helps,
    Scott

  • Hi Scott,

    thank you for your reply, yes that helped.

    And yes, I am aware of the MSP430 FRAM types. I want to use an MSP430 for a motor protection application, therefore I need a priceworthy chip with 3 ADC (16 bit with differential inputs + gain control) It looks like there is no combination with this requirement including FRAM.

    So I had a look at the MSP430i2041.

    I would need persistent data just to store hours of operation and stuff like that, max. 32 bytes or so.

    Best regards

    Jens

    PS: I was pretty shure that my question concerned the DriverLib in general, that's why I didn't specify a launchpad or device to avoid narrowing the chance of getting an answer - it was not meant as laxness

**Attention** This is a public forum