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: UART works in debug mode but not in normal battery operated mode (unable to receive data)

Part Number: MSPM0G3107

Tool/software:

Hello,

I am using MSPM0G3107 in two modes STANDBY1 and RUN0/SLEEP0. I need to keep the current consumption in the range of micro-amperes for my requirement. So before going into standby mode, I turn off the UART. Wake up from standby mode is done via a specific GPIO interrupt. Now after coming out of Standby mode, I am powering ON the UART and receiving certain amount of data via an interrupt. This operation works perfectly in debug mode. But once i move back to normal operation, the controller comes out of STANDBY0 mode (Checked by the runtime current consumption), but is unable to receive any UART data in Run0 mode inspite of turning back the UART module ON...

The main() function code is as follows:

int main(void)
{
    SYSCFG_DL_init();
    NVIC_EnableIRQ(BOLT_INT_IRQN);
    
    while (1)
    {
        modeTogglePolicy = false;
        modeTogglePolicy2 = false;
        
        DL_UART_disablePower(UART_0_INST);
        NVIC_DisableIRQ(TIMER_0_INST_INT_IRQN);
        uartStatus = DL_UART_isEnabled(UART_0_INST);
        DL_SYSCTL_setPowerPolicySTANDBY1();
        while (modeTogglePolicy == false)
        {
            __WFE();
        }
        
        DL_SYSCTL_setPowerPolicyRUN0SLEEP0();
        delay_cycles(640000);
        __WFE();

        // Add a small delay
        DL_UART_enablePower(UART_0_INST);
        delay_cycles(640000);
        DL_UART_Main_enable(UART_0_INST);
        delay_cycles(640000);
        DL_UART_Main_enableInterrupt(UART_0_INST, DL_UART_MAIN_INTERRUPT_RX);
        NVIC_EnableIRQ(UART_0_INST_INT_IRQN);

        delay_cycles(640000);

        NVIC_EnableIRQ(TIMER_0_INST_INT_IRQN);

        uartStatus = DL_UART_isEnabled(UART_0_INST);

        while (modeTogglePolicy2 == false)
        {
            __WFE();
        }
    }
}

Can someone please guide me regarding this issue,
Thanks and Regards,

  • Hi Raj,

    Have you taken a register dump for the UART peripheral settings to ensure they are all the same before standby and after standby? 

    You may also need to ensure that the UART IRQ is enabled after returning to RUN mode. 

    When in debug mode, the device goes into a pseudo low power state, so there are often some differences between how they work in low power modes when debugging vs when free-running.

  • Hello Dylan,

    Thanks for the reply. Can you kindly explain what do you mean by "register dump for the UART peripheral settings" ?? 

    Yes i have checked the same and found that the UART IRQ is enabled.. (via the isEnabled() function)

    Yes I realized that fact that debug mode involves pseudo low power state, but how can I make sure that the UART is enabled after every switch from low power standby0 mode to high power run0 mode.  

    Still I am unable to receive UART data in normal mode of operation.

    Thanks and Regards.

  • When I say a register dump of the UART peripheral settings, I mean that you can use the debugger to read out all of the UART peripheral registers, and save them to a file on your PC. If you do this both before going into standby, and after, you can see if any of the UART registers are different easily using a tool like beyondCompare. Then we can tell if the register settings are different, leading to the different behavior, or if something else in the device is resulting in this behavior.

    As for your other point, if you think it is necessary to perform a manual check that the UART is enabled after every switch you can do that, but it should not be necessary. Various low power modes do have different effects on the device behavior, but will always be the same, and are described in our TRM and datasheet. So manually checking whether it is enabled after every switch is unnecessary. It is not a random process.

  • Hello,

    The register dump of the UART peripheral settings helped a lot. The issue was related to coming out of low power mode i.e. since debug mode involves pseudo low power state, the GPIO interrupt was being received and controller could come out of low power mode. However, in actual normal mode of operation, controller was unable to come out of the low power mode due to the GPIO interrupt not being received. The current consumption was increased due to some other component causing me to think that I have successfully entered RUN0 mode.
    Your advice helped a lot.

    Thanks a lot.