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.

MSPM0G1507: Creating custom security level 1 restrictions

Part Number: MSPM0G1507
Other Parts Discussed in Thread: MSPM0G3507

Tool/software:

I am developing read/write flash protection to be applied for production software. At startup in software, I verify if Nonmain configuration has same pre-configured static structures in my software, if CRC is different (for BCR or BSL structures) than statically calculated one, I trigger re-flashing of non-main then performing a BOOTRST.

My suggested configurations for Read/Write protection is as follows:

  • App Debug policy: Disabled
  • Mass Erase Policy: Disabled
  • Factory Reset Policy: Enabled, (As the only flow back path to factory default for MAIN and NONMAIN memory)
  • TI Failure Analysis: Enabled
  • Apply write protection for the Nonmain and the Main memory.

1- I want to add a check if SWDP_MODE is disabled(unintentionally) before re-flashing Non-main. Is it possible to reflash Nonmain from user code and change SWDP_MODE from disabled to enabled? Or it is not allowed to write the Nonmain at all if SWDP_MODE was configured as enabled in case that static write protection for Nonmain is disabled (no protection)? (This is not mentioned specifically in User Guide for G series, link, it is mentioned only that any access is not allowed through SWD).

 

2- Do I need also to disable the bootloader mode (BSLMODE) to apply complete read protection for the device? Do I need in addition to explicitly disable BSL_PIN_INVOKE or will it be ignored already if BSLMODE is disabled?

3- What do you think about such boot configurations for production software?

  • Is it possible to reflash Nonmain from user code and change SWDP_MODE from disabled to enabled?

    You can modify nonmain with sw and there is no write protection.

    Here is the demo code:

    C:\ti\mspm0_sdk_2_05_00_05\examples\nortos\LP_MSPM0G3507\driverlib\flashctl_nonmain_memory_write

    Be careful to modify nonmain, and make sure program nonmain after erasing it.

    Or it is not allowed to write the Nonmain at all if SWDP_MODE was configured as enabled in case that static write protection for Nonmain is disabled (no protection)?

    If SWD is fully disabled in SWDP_MODE setting, you can modify nonmain by factory reset and software.

    2- Do I need also to disable the bootloader mode (BSLMODE) to apply complete read protection for the device? Do I need in addition to explicitly disable BSL_PIN_INVOKE or will it be ignored already if BSLMODE is disabled?

    BSL read function is disabled in default.

    You can directly disable the BSL in BSLMODE setting.

    3- What do you think about such boot configurations for production software?

    Disable the fully read out method, BSL, SWD and keep nonmain in write protection status.

    Only factory reset can reset the device, this will keep internal hardware test ability.

    It's ok.

  • Hi ,

    Thank you for your response!

    I would like to go over your answers since some are not clear to me. It would be great if you confirm it.

    1- I can modify SWDP_MODE by software even if it was "disabled"? (Then security level 2 doesn't mean that the device is permanently locked, right?)

    I can always change Non-main from software application.

    2- How can i change SWDP_MODE from disabled to enabled by factory reset? the user guide mentions that if SWDP_MODE is enabled the factory reset is "don't care" since it is not possible in case BSL is also disabled. Can you please confirm that?

    3- "BSL read function is disabled in default.": The Evalkit I received, by default, has BSL Mode enabled and BSL Pin invocation also enabled.

    4- "You can directly disable the BSL in BSLMODE setting.": will the pin invocation be ignored automatically if I disabled BSL Mode only?

    5- "Disable the fully read out method, BSL, SWD and keep nonmain in write protection status.

    Only factory reset can reset the device, this will keep internal hardware test ability.": Does this mean that I can recover always from security level 2 to security level 0 by performing a factory reset?

  • 1- I can modify SWDP_MODE by software even if it was "disabled"? (Then security level 2 doesn't mean that the device is permanently locked, right?)

    Firmware or BSL can still erase and write nonmain when SWDP_MODE disabled.

    For firmware modification, please pay attention to static write protection function:

    TRM: 7.4.2 Static Write Protection

    The static write protection scheme is configured by programming the appropriate bits in the NONMAIN flash
    region, which is read by the boot code before the main application starts. The NONMAIN flash sector can be
    statically write protected, resulting in a system in which the static write protection scheme is fully permanent and
    cannot be modified. If the NONMAIN sector is configured to be statically protected, along with any other flash
    sectors, all statically protect

    I can always change Non-main from software application.

    In case that you didn't enable nonmain static write protection.

    2- How can i change SWDP_MODE from disabled to enabled by factory reset? the user guide mentions that if SWDP_MODE is enabled the factory reset is "don't care" since it is not possible in case BSL is also disabled. Can you please confirm that?

    You can not used SWD interface to run factory reset, but if BSL is still enabled, you can run factory via BSL.

    You can also erase and write SWDP_MODE enabled to nonmain via firmware function if nonmain static write protection is not enabled in nonmain.

    3- "BSL read function is disabled in default.": The Evalkit I received, by default, has BSL Mode enabled and BSL Pin invocation also enabled.

    There are many BSL function, such as erase, write Flash function, read function is disabled in default, others are enable in default.

    4- "You can directly disable the BSL in BSLMODE setting.": will the pin invocation be ignored automatically if I disabled BSL Mode only?

    Yes.

    when the BSL is disabled, it is not possible to enter the BSL through any invocation mechanism.

    Only factory reset can reset the device, this will keep internal hardware test ability.": Does this mean that I can recover always from security level 2 to security level 0 by performing a factory reset?

    Security level control the device access level, this is controlled in nonmain configuration.

    Factory reset will reset all nonmain value to default, this will recovery from restriction mode.

    But you need at least one method to control the factory reset or nonmain modification ability.