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.

MSPM0L1306: preserve the last portion of 64KB flash to store persist information

Part Number: MSPM0L1306
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

Hello,

I would like to preserve the last portion (4KB) of 64KB flash to store persist information.

Anyone knows the way to achieve this?

I tried to modify the mspm0l1306.cmd to make the flash size to be half, assuming then the program won't touch the second half of the flash.

However, every time when I load the program to the flash, it seems the entire flash (64KB) got erased and then loaded with the new image.

The way I program the flash is (on MacOS):

#!/bin/bash
/Applications/ti/uniflash_8.4.0/dslite.sh -e -f -v my_program.out -c targetConfigs/MSPM0L1306.ccxml
Can anyone help? My goal is to not touch the final 4KB of the flash while loading the image into flash.
Best regards,
Jimmy
  • Hi Jimmy,

    1.If you want to download the code not start from 0x00.

      Please modify the cmd. file

    2. As the load will do mass erase, if you want to reserve this image, please use SWP through Sysconfig

    B.R.

    Zoey

  • seems I don't have the 'configuration NVM' tab?

  • Hi Jimmy,

    Your sysconfig's version is older than me, which is why you do not have this tab.

    For your Sysconfig, 'nonmain' is the 'configuration NVM'

  • Now I set "MAIN SWP (Remaining Sectors)" to 0x0.

    The intention is to not touch the second half of the 64KB flash.

    However, when I load the image, seems everything is still erased. Tried 2 ways:

    (1) Run "debug project" in the CCS Theia.

    (2) Use command line to load the image -- /Applications/ti/uniflash_8.4.0/dslite.sh -e -f -v my_program.out -c targetConfigs/MSPM0L1306.ccxml

    Both ways failed.

  • I added a setting which partially solved my issue but not fully.

    /Applications/ti/uniflash_8.4.0/dslite.sh -e -f -v my_program.out -c targetConfigs/MSPM0L1306.ccxml --setting FlashEraseSelection=2
    If I use this script to load the image, I found the previously stored value at addr 0x7C00 is properly preserved, however the value at addr 0xF000 still got erased somehow.
    FlashEraseSelection=2 means: Erase MAIN and NONMAIN necessary sectors only
    0. Erase MAIN memory only
    1. Erase MAIN and NONMAIN memory (see warning above)
    2. Erase MAIN and NONMAIN necessary sectors only (see warning above)
    3. Erase MAIN memory sectors by range (specify below)
    4. Do not erase Flash memory
  • Sorry I misstate my situation.

    Adding "--setting FlashEraseSelection=2" solved my problem. I can see the values at addr 0x7c00 and 0xF000 are preserved properly.

    I do have another question:

    - if I use "--setting FlashEraseSelection=3", which means "Erase MAIN memory sectors by range (specify below)", how should I specify the range as in command line settings?

  • Hi Jimmy,

    All in all,

    • There are two ways to solve this problem.
    1. Set static write protection. As you change the .cmd and its "MAIN SWP (Remaining Sectors)" is set to 0x0. When you try to download, please enable NONMAIN erase . And the flash can be loaded and SWPed. Then you can try to download the normal code which started from 0x0000.
    2. Range erase load. Enable the 'Erase MAIN memory sectors by range   and set the address through uniflash 

    By the way, Is the "--setting FlashEraseSelection=3" means "Erase MAIN memory sectors by range (specify below)? or  "--setting FlashEraseSelection=4". Actually, I am not familiar with the command line

  • The FlashEraseSelection values:
    0. Erase MAIN memory only
    1. Erase MAIN and NONMAIN memory (see warning above)
    2. Erase MAIN and NONMAIN necessary sectors only (see warning above)
    3. Erase MAIN memory sectors by range (specify below)
    4. Do not erase Flash memory