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.

TM4C1290NCPDT: sleep mode

Part Number: TM4C1290NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hi,

I am using TM4C1290NCPDT customized board & IAR compiler. 

Timer0 configured to generate ISR for every 100ms.

When system gets NMI ISR trying to put the system in sleep mode.

Enable sleep mode using below configuration sequence,

SysCtlPeripheralClockGating(true);
SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_TIMER0);
SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_UART6);
SysCtlSleep();

System not getting wake up, always in sleep mode mode.Timer0 ISR also not occurring while in sleep mode.

if Voltage increased to normal power still system in sleep mode.

Kindly help.

Thanks.

  • HI,

      Would you please reference the TivaWare example project at C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\sleep_modes. This example demonstrates entering sleep mode and wake up from sleep using Timer0, very similar to what you are trying to achieve. 

  • Hi,

    SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_TIMER0);
    SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_TIMER1);
    SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_UART6);
    SysCtlPeripheralClockGating(true);
    SysCtlLDOSleepSet(SYSCTL_LDO_1_15V);
    SysCtlSleep();

    followed similar configuration but system keep on sleep mode. It looks like once system enter into sleep mode not generating any interrupt(timer/uart).

    Sleep mode not work with debugger?(not Deep sleep)

    will it not possible to use same clock frequency? MAP_SysCtlClockFreqSet need to configure differently in sleep & run mode.

    Kindly help.

    Thanks.

  • Hi,

      I'm sorry that I'm currently out of office and will come back on 1/4/2022. 

  • Hi

    In Sleep mode interrupt not happening,

    tried with timer0 & UART as well. Will it required to configure all the peripherals used to enable/disable.

    For example in application if used CAN,UART,Timer0,1,SPI,NMI will it required all the peripherals need to enable/disable in sleep mode? using API SysCtlPeripheralSleepDisable(uint32_t ui32Peripheral) or SysCtlPeripheralSleepEnable(uint32_t ui32Peripheral)

    MAP_SysCtlClockFreqSet((SYSCTL_OSC_INT |
    SYSCTL_USE_OSC |
    SYSCTL_MAIN_OSC_DIS),
    16000000); need to set else without that will it work?

    Thanks.

  • Hi,

    For example in application if used CAN,UART,Timer0,1,SPI,NMI will it required all the peripherals need to enable/disable in sleep mode?

    If you are going to use these peripherals in sleep mode then you need to enable them for sleep mode. 

    I modify the existing TivaWare sleep_modes example to only focus on sleep mode, not deepsleep. I don't have any problem running on the LaunchPad. You need to make sure you only run any sleep and deep sleep modes without the debugger connected.  

      Please also be aware of the below notes mentioned in the datasheet concerning the entry and exit of sleep mode. 

    Caution – If the Cortex-M4F Debug Access Port (DAP) has been enabled, and the device wakes from
    a low power sleep or deep-sleep mode, the core may start executing code before all clocks to peripherals
    have been restored to their Run mode configuration. The DAP is usually enabled by software tools
    accessing the JTAG or SWD interface when debugging or flash programming. If this condition occurs,
    a Hard Fault is triggered when software accesses a peripheral with an invalid clock.
    A software delay loop can be used at the beginning of the interrupt routine that is used to wake up a
    system from a WFI (Wait For Interrupt) instruction. This stalls the execution of any code that accesses
    a peripheral register that might cause a fault. This loop can be removed for production software as the
    DAP is most likely not enabled during normal execution.
    Because the DAP is disabled by default (power on reset), the user can also power cycle the device. The
    DAP is not enabled unless it is enabled through the JTAG or SWD interface.

    Note: If the Debug Access Port is enabled in Run Mode and attempts to transition into Deep-Sleep
    mode, the device is prevented from entering Deep-Sleep

    I will suggest you do the following.

    - Run the attached example on the LanchPad and see if it works. 

    - If the above works, compare the example to your own code. 

    - Run the attached example on your custom board and see if it works. If it doesn't work then it may indicate some hardware difference between your custom board and LauchPad that is preventing the example from entry/exit of sleep mode. 

     - Run your custom code on the LanchPad. If it doesn't work then please compare your code with the example since we know the example works on the LaunchPad. 

     - Make sure you disconnect the debugger from your target when you run the example and also be aware of the notes of concern mentioned above. 

    sleep_mode_only.zip