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.

MSP430FR5969: Coding question: One-time-write constants?

Part Number: MSP430FR5969
Other Parts Discussed in Thread: MSP-FET

I am building a board around an MSP430FR5969 which will be used as the controller on a platform, with individual units getting different hardware configurations. As an example, there are several heaters, and some units may have 4 heaters, while others may have 8 (just an example). I have been reading up on how to use the FRAM here: www.ti.com/.../slaa628.pdf

I'd like to program the boards, and leave them on a shelf until we are ready to build up a full system. During the final assembly checkout, I would like to write values to several constants, (such as numHeaters and productSerialString[16]), and then never let those values be written to again.

Would this approach work?

Initial code is setup with placeholders in the respective constants, and the linker file puts those constants into the Constants MPU memory segment. In the _system_pre_init() function, I would actually set the MPUSAM register using a constant itself, which allows writing to the constants section. I am interfacing with my MSP430 through I2C, and I can create a command which allows updating the values of the constants. At board checkout time, I could run the commands to assign the serial number and configuration values, and finally update the MPUSAM constant to turn off write access to the Constants memory segment. Then, after a hard-reset, the _system_pre_init() function would shut off write access to that memory segment.

This should effectively shutoff the possibility of code overwriting the constants, right? I'm not too worried about someone plugging a debugger in and changing constants, but I do want to avoid the possibility of a software update overwriting these values. I haven't learned how to do an I2C SW update yet, but that is on my list of future functionality.

Thanks,

Paul

  • Hey Paul,

    Yes, this should work. You may want to look at the Information Memory partition - this is 512 bytes of memory dedicated to store application-specific info like IDs or version numbers.

    Here is a MPU training video for reference:
    training.ti.com/msp430-fram-microcontrollers-memory-protection-unit-mpu

    Here is also the user's guide for the FR5969 device. You will want to look at section 9.2
    www.ti.com/.../slau367o.pdf

    Please let me know if you have any more questions.

    -Mitch
  • There is no true OTP memory in the MSP430. The Information Memory is in a separate address area and protectable with the MPU, so that's as protected as you'll get. The default program-load option in CCS is to Not wipe out Information memory (though that option exists, so be careful).

    I would suggest that you avoid having code onboard which can write to information memory, since it's code which can be accidentally invoked. Rather I suggest using an external mechanism, e.g. a programmer (FET) for one-time personalization.

    You may want to look at what Elprotronic [.com] offers. Their software talks through standard TI programmers (USB-FET, ezFET) and is capable of storing e.g. serial numbers and CRCs into Information memory. They also sell their own programmers which presumably have some value-added.

    They have a free/limited-function software version you can try, and even their pay-for versions aren't terribly expensive. I forget whether their serialization feature is in the free or (only) pay-for version. I've used the free version (on the F2 series) and it did all the basics just fine.
  • Thanks to both Mitch and Bruce! I agree that adding code which allows updating the Information Memory is an invitation for trouble. At $70, I think the FET-Pro Software from Elprotronic is worth the investment if It can do what I think it can. I'm sure I could try to roll my own through the MSP-FET hardware I have, but It would take me a lot longer then $70 worth!

    Thanks,
    Paul

**Attention** This is a public forum