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.

MSP430 + TIRTOS write to internal FLASH

Other Parts Discussed in Thread: MSP430F5659

I need to write some user-data to the internal FLASH (and read it later on).

What is the best way to do it when using TI-RTOS?

Thanks,

 Boaz

  • Hi Boaz,
    Which MSP430 device are you using? I would try the driverlib FlashCtl APIs if they are supported for your device. We don't have a TI-RTOS driver for non-volatile storage (NVS) for MSP430 devices, but we do for some other devices (e.g. TivaC, MSP432). Which version of TI-RTOS are you using? If you are using 2.16.00, you can look at ti/drivers/nvs/NVSMSP432.c to at least get an idea of how to use the FlashCtl APIs.
    Best regards,
    Janet
  • Thanks you Janet, it was easier than I thought :)

    I'm posting this  other users:

    My device is MSP430F5659, TIRTOS 2.14.03.28. I used the INFO section, which is configured such that the linker will not place code there. Then:

    • Writing is done by the FLASHCTL example (erasing segment and then writing it)
    • Reading is simply a matter of accessing the constant address (in my case INFOB: 0x1900), by doing something like: static UserInfo* _flashAsUserInfo = (UserInfo*)INFOB_START;

    Supposing I require a larger 64K bank, can you please explain how to configure the linker to reserve this section for user info?

  • Hi Boaz,

    Here is an example from an MSP432 linker command file:

    MEMORY
    {
        MAIN       (RX) : origin = 0x00000000, length = 0x0003C000
        MAIN_NVS   (RW) : origin = 0x0003C000, length = 0x00004000     /* 4 pages */
        INFO       (RX) : origin = 0x00200000, length = 0x00004000
        SRAM_CODE  (RWX): origin = 0x01000000, length = 0x00010000
        SRAM_DATA  (RW) : origin = 0x20000000, length = 0x00010000
    }

    Four pages are taken from MAIN and reserved for the application (MAIN_NVS).

    Best regards,

        Janet