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.

MSPM0L1228: enable VBAT but fail to boot up

Part Number: MSPM0L1228
Other Parts Discussed in Thread: LP-MSPM0L2228, MSPM0L2228

Tool/software:

hi Expert,

when customer uses function below to enable super charge,

DL_SYSCTL_enableSuperCapacitor()

MCU can boot up and work well at first power up. if set reset pin to low, MCU cannot boot up. Already confirm that MCU is not in boot mode.

Green: VDD

Yellow: rst_n

if they remove function below, it can work no matter power cycle or reset mcu by set low reset pin.

DL_SYSCTL_enableSuperCapacitor()

miss anything?

BR,

frank

  • Hi Frank

    To enable the SuperCapacitor function of MSPM0, there should also be an external large capacity and a resister connected to VBAT pin. Could you please double check with customer about the hardware they are using, especially the VBAT connection. 

    Another question is: what do you mean by "confirm that MCU is not in boot mode"? Could MCU stall in the BSL mode and entering a low power mode? Could you please monitor the voltage of PA18 when reset by NRST or POR?

    Best Regards,

    Pengfei

  • Pengfei,

    yes, they put 2F supercap on board.

    if they change R193 to 0 Ohmn, the issue is gone.

    Any idea?

    BR,

    frank

  • Pengfei,

    i can reproduce the issue on evm.

    I use TI LP-MSPM0L2228 rev A and move VBAT_IN jumper from xds to supercap.

    i only add code below in example "uart_rw_multibyte_fifo_poll_LP_MSPM0L2228_nortos_ticlang".

    int main(void)
    {
    DL_SYSCTL_enableSuperCapacitor();

    SYSCFG_DL_init();

    first power on is ok.

    when i press reset button, it's failed to power up and doesn't send out uart message.

    Any idea what i miss? Should I add some code after enable VBAT charge.

    BR,

    frank

  • Hi Frank,

    Thanks for your test and addition information., it is helpful. I also test and reproduce this problem from my side.

    And after debugging, I found the program is stall in Default_Handler() caused by NMI exception. And the NMI exception source is VBATUP, which is generated when VBAT is powered on. When we apply DL_SYSCTL_enableSuperCapacitor(); API, VDD start to charge VBAT, and VBAT is powered on , then trigger the NMI interrupt and stall in Default handler.

    So it could explain why MCU could works well if we keep VBAT connected to VCC directly or if we not use DL_SYSCTL_enableSuperCapacitor(); API in program.

    A workaround for this may be to write the VBATUP event handler program in NMI interrupt handler, such as below, to make sure the program not stall in Default handler. (If no NMI_Handler() is defined, program will execute Default_Handler for NIM exception handling.)

    void NMI_Handler(){
       DL_SYSCTL_NMI_IIDX gNMIIntr = DL_SYSCTL_getPendingNonMaskableInterrupt();
       switch (gNMIIntr){
            case DL_SYSCTL_NMI_IIDX_VBAT_ON:{
                gBATPowerStatus = 1;
                break;
            }
            case DL_SYSCTL_NMI_IIDX_VBAT_OFF:{
                gBATPowerStatus = 0;
                break;
            }
            default:{
                break;
            }
       }
    }

    Best Regards,

    Pengfei

  • Pengfei,

    I add the  NMI_Handler() in code.

    I do test below.

    time mark 0: press reset button and hold until VBAT drops <1V.

    time mark 1: release reset button but MCU doesn't get back

    time mark 2: power cycle evm and mcu work normally.

    time mark 3:  press reset button and release quickly. MCU works normally.

    uarttx: mcu sends uart message if mcu works normally.

    strobe: signal high means that the code gets into NMI_Handler()

    vbat_in: vbat_in voltage

    is the behavior correct?

    if vbat is low, VDD is 3.3v and press reset, MCU would not work. is that correct?

    BR,

    frank

  • Hi Frank,

    Which version of MSPM0L2228 Launchpad are you using? Rev. A or Rev. E?

    I did the similar test (hold on NRST button for a long time to let VBAT at a low voltage level and then release), and found no problem for MCU start up in Rev. A launchpad.

  • Pengfei,

    I use newest EVM. rev.A.

    fw change: DL_SYSCTL_enableSuperCapacitor()

    EVM jumper change: as below.

    BR,

    frank

  • Hi Frank,

    I think we have the same EVM version and same hardware connection, but still as I said it seems everything works fine from my side.

    • What is the impact/concern for customer's application of current situation? (after adding NMI handler)
    • Could you share your code so I could take some cross test.
  • Pengfei,

    for below, it means that customer can set reset pin low but need to make sure VBAT voltage high enough.

    What is the impact/concern for customer's application of current situation? (after adding NMI handler)

    for below, you can check the attachment.

    /*
     * Copyright (c) 2021, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    #include "ti_msp_dl_config.h"
    
    /*
     * Configure the internal loopback mode.
     * Note that data received on the UART RXD IO pin will be ignored when
     * loopback is enabled.
     */
    #define ENABLE_LOOPBACK_MODE true
    
    /*
     * Number of bytes for UART packet size
     * The packet will be transmitted by the UART.
     * This example uses FIFOs with polling, and the maximum FIFO size is 4.
     * Refer to interrupt examples to handle larger packets.
     */
    #define UART_PACKET_SIZE (4)
    
    /* Delay for 5ms to ensure UART TX is idle before starting transmission */
    #define UART_TX_DELAY (160000)
    
    /* Data for UART to transmit */
    uint8_t txPacket[UART_PACKET_SIZE] = {'M', 'S', 'P', '!'};
    
    /* Data received from UART */
    uint8_t rxPacket[UART_PACKET_SIZE];
    
    
    int main(void)
    {
        DL_SYSCTL_enableSuperCapacitor();
    
        SYSCFG_DL_init();
    
        /* Optional delay to ensure UART TX is idle before starting transmission */
        delay_cycles(UART_TX_DELAY);
    
        /* Set LED to indicate start of transfer */
        DL_GPIO_clearPins(GPIO_LEDS_USER_LED_1_PORT, GPIO_LEDS_USER_LED_1_PIN);
    
        /* Fills TX FIFO with data and transmits the data */
        DL_UART_Main_fillTXFIFO(UART_0_INST, &txPacket[0], UART_PACKET_SIZE);
    
        /* Wait until all bytes have been transmitted and the TX FIFO is empty */
        while (DL_UART_Main_isBusy(UART_0_INST))
            ;
    
        /*
         * Wait to receive the UART data
         * This loop expects UART_PACKET_SIZE bytes
         */
        for (uint8_t i = 0; i < UART_PACKET_SIZE; i++) {
            rxPacket[i] = DL_UART_receiveDataBlocking(UART_0_INST);
        }
    
        /* If write and read were successful, toggle LED */
        while (1) {
            DL_GPIO_togglePins(GPIO_LEDS_USER_LED_1_PORT,
                GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN);
            delay_cycles(5000000);
        }
    }
    uint8_t gBATPowerStatus = 0;
    void NMI_Handler(){
       DL_SYSCTL_NMI_IIDX gNMIIntr = DL_SYSCTL_getPendingNonMaskableInterrupt();
       DL_GPIO_setPins(GPIO_LEDS_USER_LED_4_B_PORT,
                                      GPIO_LEDS_USER_LED_4_B_PIN);
       switch (gNMIIntr){
            case DL_SYSCTL_NMI_IIDX_VBAT_ON:{
                gBATPowerStatus = 1;
                DL_GPIO_setPins(GPIO_LEDS_USER_LED_4_R_PORT,
                                   GPIO_LEDS_USER_LED_4_R_PIN);
                break;
            }
            case DL_SYSCTL_NMI_IIDX_VBAT_OFF:{
                gBATPowerStatus = 0;
                DL_GPIO_setPins(GPIO_LEDS_USER_LED_4_G_PORT,
                                               GPIO_LEDS_USER_LED_4_G_PIN);
                break;
            }
            default:{
                break;
            }
       }
    }
    
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/uart_5F00_rw_5F00_multibyte_5F00_fifo_5F00_poll.syscfg

    Could you share your code so I could take some cross test.

    BR,

    frank

  • Hi Frank,

    I tested with the syscfg and source code of your. And the program could always successfully boot up, even if I press NRST for over 20s, or connect VBAT to GND when NRST low and then release NRST.

    Only one thing to be noticed, the example you used will waiting for UART data received, and block in  DL_UART_receiveDataBlocking(). So the GPIO PA0 may not toggle. So just comment this part, and I could got MCU boot up every time. 

    By the way, you could double check your PA18 wave when MCU boot up, in case of PA18 is set high to make MCU in BSL status.

    Best Regards,

    Pengfei

  • PengFei,

    Do you remove the jump on J18?

    BR,

    frank

  • Hi Frank,

    No. I connect VBAT pin with VBAT_SC pin for super capacity connection.

    Regards,

    Pengfei