SLAAEQ5 March   2025 MSPM0C1103 , MSPM0C1104 , MSPM0C1104-Q1 , MSPM0C1105 , MSPM0C1106 , MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3518 , MSPM0G3518-Q1 , MSPM0G3519 , MSPM0G3519-Q1 , MSPM0H3216 , MSPM0L1105 , MSPM0L1106 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346 , MSPM0L2228 , MSPM0L2228-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Cyber Security Requirement Introduction
    1. 1.1 Cyber Security Requirement for MSPM0
  5. 2MSPM0 Debug Register Introduction
  6. 3Implementation
    1. 3.1 Debugger with Mailbox
    2. 3.2 MCU
      1. 3.2.1 Usage and Configuration of Nonmain
      2. 3.2.2 MSPM0 Software Implementation
  7. 4Execution
    1. 4.1 First Time Flashing
    2. 4.2 Access to Locked MCU
  8. 5How to Customize Passwords
    1. 5.1 Password
    2. 5.2 Password Length
  9. 6Summary
  10. 7References

Password Length

  1. Demo code – boot_configwithPassword.h; password
    #define PASSWORD_WORD_LEN                                                  (4U)
    #define DebugAccess_Password0                                      (0x00000001)
    #define DebugAccess_Password1                                      (0x00000002)
    #define DebugAccess_Password2                                      (0x00000003)
    #define DebugAccess_Password3                                      (0x00000004)
  2. Demo code – boot_configwithPassword.h: Password in BCR_Config struct
    /* Bootcode user configuration structure */
    typedef struct
    {
        /*! Configuration signature */
        uint32_t bcrConfigID;
        /*! Enable/disable AHB-AP, ET-AP, PWR-AP.
         * One of @ref BCR_CFG_DEBUG_ACCESS */
        BCR_CFG_DEBUG_ACCESS debugAccess;
        /*! Enable/disable SWD port access. One of @ref BCR_CFG_SWDP_MODE */
        BCR_CFG_SWDP_MODE swdpMode;
        /*! The factory reset mode. One of @ref BCR_CFG_FACTORY_RESET */
        BCR_CFG_FACTORY_RESET factoryResetMode;
        /*! Non Main Flash Static Write Protection.
        * One of @ref BCR_CFG_NON_MAIN_STATIC_PROT */
        BCR_CFG_NON_MAIN_STATIC_PROT staticWriteProtectionNonMain;
        /*! Programs static write protection of first 32K bytes.
         * One bit corresponds to one sector, LSB is Sector 0. Setting a bit
         * to 0 disables write, setting a bit to 1 enables write Possible values:
         *    - 0x0 to 0xFFFFFFFF */
        uint32_t staticWriteProtectionMainLow;
        /*! Programs static write protection of first 32K bytes.
         * One bit corresponds to eight sectors. Setting a bit
         * to 0 disables write, setting a bit to 1 enables write Possible values:
         *    - 0x0 to 0xFFFFFFF0 */
        uint32_t staticWriteProtectionMainHigh;
        /*! Reserved */
        uint32_t reserved;
        uint32_t password0;
        uint32_t password1;
        uint32_t password2;
        uint32_t password3;
        //Can add password length if needed
    } BCR_Config;
    
  3. Demo code – boot_configwithPassword.c: BCRConfig_origin variable to configuration Nonmain
    PLACE_IN_MEMORY(".BCRConfig")
    const BCR_Config BCRConfig_origin =
    {
        .bcrConfigID          = 0x3,
        .debugAccess          = BCR_CFG_DEBUG_ACCESS_DIS,
        .swdpMode             = BCR_CFG_SWDP_EN,
        .factoryResetMode     = BCR_CFG_FACTORY_RESET_DIS,
        .staticWriteProtectionNonMain  = BCR_CFG_NON_MAIN_STATIC_PROT_DIS,
        .staticWriteProtectionMainLow  = CFG_DEFAULT_VALUE,
        .staticWriteProtectionMainHigh = CFG_DEFAULT_VALUE,
        .reserved = 0xFFFFFFFFU,
        .password0 = DebugAccess_Password0,
        .password1 = DebugAccess_Password1,
        .password2 = DebugAccess_Password2,
        .password3 = DebugAccess_Password3,
    };
  4. Demo code – check_password.c: Para_init function
    void Para_init(void)
    {
        AHPAccess = false;
        BCRConfig_update.bcrConfigID          = 0x3;
        BCRConfig_update.debugAccess          = BCR_CFG_DEBUG_ACCESS_DIS;
        BCRConfig_update.swdpMode             = BCR_CFG_SWDP_EN;
        BCRConfig_update.factoryResetMode     = BCR_CFG_FACTORY_RESET_DIS;
        BCRConfig_update.staticWriteProtectionNonMain  = BCR_CFG_NON_MAIN_STATIC_PROT_DIS;
        BCRConfig_update.staticWriteProtectionMainLow  = CFG_DEFAULT_VALUE;
        BCRConfig_update.staticWriteProtectionMainHigh = CFG_DEFAULT_VALUE;
        BCRConfig_update.reserved = 0xFFFFFFFFU;
        BCRConfig_update.password0 = DebugAccess_Password0;
        BCRConfig_update.password1 = DebugAccess_Password1;
        BCRConfig_update.password2 = DebugAccess_Password2;
        BCRConfig_update.password3 = DebugAccess_Password3;
    }
  5. Demo code –check_password.c: Nonmain_check function
  6. mspm0_cs_dap_init_V2: Password_LENGTH
    #define PASSWORD_LENGTH                                                  (4U)
  7. mspm0_cs_dap_init_V2: GEL_MSPM0_C_PasswordAuth(autoReset) function. The password length has been changed and cannot use CCS GUI as human interface, so users need to add an actual password in CCS script and send the debugger to transmit.