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.

MSPM0G3519: Secure memory area for storing sensitive information

Part Number: MSPM0G3519
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi ,

I want to know is there any specific area where i can store data that can't be modify again. Means that area should be one time writable and after that at any how user can't change but able to read only. and if I want to share some data securely between application code and bootloader code then how can I do this? 

  • Hi Mehul,

    You can write protect up to the first 32kb of flash memory at a resolution of one sector = 1kb, you can protect the rest of flash at a resolution of one sector = 8kb. If there are no read protect firewalls in front of the bootloader flash, the write protected data can be shared between application and bootloader code.

    Best Regards,
    Brian

  • Do you have example implementation of this? and if i write protect first 32 kb of flash then my Bootloader will be after that 32kb right? 

  • Also do this controller have memory area that we can program only once and never ever can change at any way it means it will be hardcoded to that chip.

  • There is not an example project for flash write protect, but you can configure it from within the Configuration NVM section of SysConfig. I'll include the flash memory map from the TRM here, but in short yes your bootloader code will be after your main flash.

    Best Regards,
    Brian

  • There is a method for making this work:

    1. Write data into flash
    2. Configure the sector(s) the data is in to be write protected
    3. Enable Mass Erase and Factory Reset with password or disable within Non-Main
    4. Write Protect Non-Main configuration

    If Factory Reset is disabled and Non-Main is write protected, the non-main configuration and all settings made within are immutable from that point on. This includes the write protection of your data and Bootloader code.

    Best Regards,
    Brian

  • Hi Brian, so you mean after following above steps data cant be change? not even programmatically.

  • Hi Mehul,

    Yes, if you disable factory reset and mass erase, while having Non-Main write protected, any and all configurations made within Non-Main will be permanently locked and Inaccessible via programming.

    Best Regards,
    Brian

  • So, if I want to store my public key which I used to image verification and that key I am able to write one time only and that will be parentally getting written into that chip.  then how can I do that? I mean how I can write my key into non main memory? and this is only possible with non-main region? 

  • Hi Mehul,

    You would be writing your key into main flash. After it is written to main flash, configure the sector the key is located in to be write protected. Protecting this sector of memory is done within the Boot Configuration Routine (BCR) Configuration. BCR is located in NONMAIN memory.

    To ensure the write protection of your key in main flash is permanent, Configuration NVM (NONMAIN) should be write protected with factory reset disabled. 

    Best Regards,
    Brian