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.

MSPM0G3107-Q1: Disabling Default BSL Invoke on PA18 and Configuring It as GPIO in Code compressor studio

Part Number: MSPM0G3107-Q1
Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH

Currently, in our project, we do not want to use the default BSL Invoke function on PA18, as we plan to use PA18 as a normal GPIO input. Could you please guide us on how to disable the default BSL Invoke function for PA18 in Code Composer Studio (CCS) and configure PA18 to function only as a GPIO?

  • Hello GANESH,

    Open the sysconfig in your project, and go to the "Configuration NVM", you will find the "Bootstrap Loader (BSL) Configuration" module, in this module, you can choose to disable BSL invoke pin check, or you can choose to use other BSL invoke pin not use PA18. 

    BR,

    Janz Bai

  • Thanks for your response. Can you please provide feedback on the below query!

    Could you please confirm whether simply unchecking “Enable BSL Invoke Pin Check” in SysConfig will disable the default BSL invoke function on PA18 and allow PA18 to be used exclusively as a GPIO?

    We currently have an external pull-up resistor connected to PA18 for our application. Could this pull-up cause any issue with the BSL configuration or prevent the MCU from operating in standalone mode?

    As of now, our application works correctly in debug mode but does not work in standalone mode, so we would like to confirm whether disabling the default BSL invoke function on PA18 will resolve this issue.

  • If you disable BSL invoke pin check, MCU won't check the invoke pin state when powering up. If you disable BSL invoke pin check, the pull-up resistor on PA18 won't affect MCU running. If you still need BSL function and want to use GPIO to trigger BSL, just don't want to use PA18 to do trigger, you can keep "enable BSL invoke pin check" and just choose another pin to do trigger, not use PA18. 

    Please notice that the NONMAIN configuration will be valid when next MCU power up.

    BR,

    Janz Bai

  • If we do not intend to use the BSL Invoke function, is it necessary to add an external pull-down resistor on PA18 to ensure safe and reliable MCU operation in standalone mode?

  • If you don't need BSL function, and you have already disabled the invoke pin check, you don't need to add pull-down resistor on PA18.

    BR,

    Janz Bai

  • Hi ,

    I am using Uni Flash tool to mass erase but it is not erasing the Nomain sections and flashed one Nomain configured code and I am not sure what is flashed?

    How can I erase and ensure I am flashing the correct code and also the .out file doesn't include these sections.

    My scope is to not use the PA18 pin as BSL invoke how can I make it.

    Can you please provide me complete configuration and how to flash this hex file and later only application we can flash with multiple changes which would not affect this.

  • About how to use the Uniflash to program NONMAIN, please see this guide: MSPM0 MCUs Development Guide (Rev. G)

    About the description of NONMAIN region (which address store which data, what is its function), please see the TRM:MSPM0 G-Series 80-MHz Microcontrollers Technical Reference Manual (Rev. E) module 1.4.5

    If you want your .out file don't include NONMAIN region, don't use the "Configuration NVM" in sysconfig. Don't use the  "Configuration NVM" in sysconfig, then the hex file generated by your project won't include NONMAIN region data. About how to use Uniflash to program without NONMAIN, please this guide  MSPM0 MCUs Development Guide (Rev. G)

    About how to "not use PA18 as BSL invoke pin", hoe to configure it, I have replied it in before response for many times. 

    BR,

    Janz Bai

  • Thanks for the reply.

    But now we configured the NVM and the PA18 pin set as low in Sysconfig.

    But the PCB we use, the PA18 is pulled high with 10k resistor.

    Now after flashing the application along with BSL files included, I can see the PCB is working stand alone.

    Below attached the config and BSL code for reference.

    The question is the HW PCB PA18 pin is used for the other purpose to read the switch.

    and now configured as low in sysconfig and it is working can you please confirm on this.

      

    PLACE_IN_MEMORY(".BCRConfig")
    const BCR_Config BCRConfig =
    {
        .bcrConfigID          = 0x1,
        .debugAccess          = BCR_CFG_DEBUG_ACCESS_EN,
        .swdpMode             = BCR_CFG_SWDP_EN,
        .tifaMode             = BCR_CFG_TIFA_EN,
        .bslPinInvokeEnable   = BCR_CFG_BSL_PIN_INVOKE_EN,
        .passwordDebugLock    = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE},
        .fastBootMode         = BCR_CFG_FAST_BOOT_DIS,
        .bootloaderMode       = BCR_CFG_BOOTLOADER_MODE_EN,
        .massEraseMode        = BCR_CFG_MASS_ERASE_EN,
        .factoryResetMode     = BCR_CFG_FACTORY_RESET_EN,
        .passwordMassErase    = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE},
        .passwordFactoryReset = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE},
        .staticWriteProtectionMainLow  = CFG_DEFAULT_VALUE,
        .staticWriteProtectionMainHigh = CFG_DEFAULT_VALUE,
        .staticWriteProtectionNonMain  = BCR_CFG_NON_MAIN_STATIC_PROT_DIS,
        .secureBootMode                = BCR_CFG_SECURE_BOOT_DIS,
        .userSecureAppStartAddr        = CFG_DEFAULT_VALUE,
        .userSecureAppLength           = CFG_DEFAULT_VALUE,
        .userSecureAppCrc              = CFG_DEFAULT_VALUE,
        .userCfgCRC                    = 0x1879dac3,
    };
    /* Defines for BSL UART and I2C interface pins */
    #define DEF_UART_RXD_PAD                                                 (0x16)
    #define DEF_UART_RXD_MUX                                                  (0x2)
    #define DEF_UART_TXD_PAD                                                 (0x15)
    #define DEF_UART_TXD_MUX                                                  (0x2)
    #define DEF_I2C_SDA_PAD                                                   (0x1)
    #define DEF_I2C_SDA_MUX                                                   (0x3)
    #define DEF_I2C_SCL_PAD                                                   (0x2)
    #define DEF_I2C_SCL_MUX                                                   (0x3)

    #define DEFAULT_BSL_PIN_INVOCATION_DATA0                       ((uint8_t) 0x28)
    #define DEFAULT_BSL_PIN_INVOCATION_DATA1                       ((uint8_t) 0x12)
  • If you don't need BSL function, you can disable BSL invoke pin check directly. Please go to "GPIO" module in sysconfig to configure the PA18 as the function you want. This BSL configuration region is just used for MCU boot process, it is not related to your application code part. you configure PA18 as Low here just means that "in MCU power up process, MCU will check whether PA18 is low, if it is low, MCU will enter BSL mode".  I think my explanation can help you understand what you need to do, and it seems that you still have some misunderstand of our NONMAIN and BSL, if you still have confuse, please see our TRM to check more details: MSPM0 MCUs Development Guide (Rev. G)

  • Hi Janz,

    But by default, this check is enabled, so when I disable this PIN for BSL check I need to this flash this configuration at least once before flashing application to all of my new boards. Correct?

  • You can include your application code and NONMAIN configuration in one programming file and program them into your boards. For the blank device on your board, even though it will enter BSL mode at the first power up because BSL invoke check is enabled, you can still program the code into device. Because even though in BSL mode, you can still use SWD to program code.

    Because NONMAIN data will be valid when power up again, when your board second time power up, "BSL invoke pin not check" will be valid, and device won't enter BSL mode, will run your application code. 

    If you are still confused about detailed knowledge about NONMAIN, please see the TRM MSPM0 MCUs Development Guide (Rev. G)

**Attention** This is a public forum