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.

MSP432P401R: Timer32 sleep routine not working with MAP_PCM_gotoLPM0InterruptSafe()

Part Number: MSP432P401R

Hello! I'm trying to make a sleep routine using Timer32 on a MSP-EXP432P401R Rev. 1.0 board (DriverLib - v4_00_00_11). This is the code I'm using:

void Timer32_sleep_cycles(uint32_t cycles)
{
	/* Configuring Timer32 to "uint32_t cycles" cycles of MCLK in periodic mode */
	MAP_Timer32_initModule(TIMER32_0_BASE, TIMER32_PRESCALER_1, TIMER32_32BIT, TIMER32_PERIODIC_MODE);
	MAP_Interrupt_enableInterrupt(INT_T32_INTC);
	MAP_Timer32_setCount(TIMER32_0_BASE, cycles);
	MAP_Timer32_enableInterrupt(TIMER32_0_BASE);
	MAP_Timer32_startTimer(TIMER32_0_BASE, true);

	MAP_Interrupt_enableSleepOnIsrExit();
	MAP_Interrupt_enableMaster();
	MAP_PCM_gotoLPM0InterruptSafe();
	MAP_Interrupt_enableMaster();
}

void T32_INTC_IRQHandler(void)
{
	Timer32_clearInterruptFlag(TIMER32_0_BASE);
	MAP_Interrupt_disableSleepOnIsrExit();
}

The function works if I use MAP_PCM_gotoLPM0(), but if I use the interrupt safe version, the program hangs in Default_Handler(void).

Why is this happening and, most importantly, how can it be resolved?

  • Hi,
    Looks like you are having multiple issues (based on the other Timer 32 post).
    Is there a chance you can update your LaunchPad and get back to us?

    Also can you tell me how you found the DriverLib version number?
    This can be found in the SDK install under "Docs/driverlib".

    -Priya
  • Yes, I will receive next week a Rev. 2.0 Launchpad and I will test the code again.

    I'm using MSP432 SDK v1.30.00.40 and I read the DriverLib version from the project template commentary:

    *
     * -------------------------------------------
     *    MSP432 DriverLib - v4_00_00_11 
     * -------------------------------------------
     *
     * --COPYRIGHT--,BSD,BSD
     * Copyright (c) 2017, Texas Instruments Incorporated
     * All rights reserved.

    In Docs/driverlib/release_notes.html it says MSP432 DriverLib  3_50_00_02. Just for my information, which is the correct version?

  • I've tried the code on a Rev. 2.0 board and it works fine. The problem was that I was using an older version of the chip.

**Attention** This is a public forum