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.

Compiler/TMS570LS1227: TMS570 HOW to goto low-power and how to wake up

Part Number: TMS570LS1227

Tool/software: TI C/C++ Compiler

HI!

during use TMS570LS1227 , how to in to the Low power state ,and when the CPU into sleep,how to wake up!

very thank you!

  • Hello,

    Hercules MCUs support 3 low-power mode: Doze, Snooze, and Sleep.

    To enter the low power mode (sleep mode as example), the following sequence should be followed:

    1. Program the flash banks and flash pump fall-back modes to be “sleep”.

    2. Disable the clock sources that are not required to be kept active

    3. Disable the clock domains that are not required to be kept active.

    4. Idle the Cortex-R4F core

    The table2-11 lists all the wake-up options: GIO/CAN/SCI interrupts can be used to wake-up the device.

     

    Regards,

    QJ

  • Thank you !
    during low power state ,only interrupts can wake-up .e.g. enable GIO interrupt before sleep , and if detect GIO interrupt , the CPU wake-up?
    Do you need other conditions? configuration Clock Registers or Flash registers?
    Now, according to the method you provide,I can Doze,Snooze,and Sleep, could wake-up!
    Could you provide the method of wake-up detail?
    Thank you very much!
  • these my code :

    init clock ,a little code:

    /** - Setup GCLK, HCLK and VCLK clock source for normal operation, power down mode and after wakeup */
    systemREG1->GHVSRC = (uint32)((uint32)SYS_OSC<< 24U) //debug sys_osc
    | (uint32)((uint32)SYS_OSC<< 16U)
    | (uint32)((uint32)SYS_PLL1 << 0U);




    //mode : #define SYS_DOZE_MODE 0x000F3F02U
    #define SYS_SNOOZE_MODE 0x000F3F03U
    #define SYS_SLEEP_MODE 0x000FFFFFU
    void systemPowerDown(uint32 mode)
    {
    /* USER CODE BEGIN (26) */

    flashWREG->FBAC = 0x00000000U
    |(uint32)((uint32)15U<< 8U) //BAGP
    |(uint32)((uint32)15U); //VREADST

    /** - Setup flash bank power modes */
    flashWREG->FBFALLBACK = 0x00000000U
    | (uint32)((uint32)SYS_SLEEP<< 14U) /* BANK 7 SYS_SLEEP = 0U */
    | (uint32)((uint32)SYS_SLEEP << 2U) /* BANK 1 */
    | (uint32)((uint32)SYS_SLEEP << 0U); /* BANK 0 */

    /* USER CODE END */

    /* Disable clock sources */
    systemREG1->CSDISSET = mode & 0x000000FFU;

    /* Disable clock domains */
    systemREG1->CDDIS = (mode >> 8U) & 0x00000FFFU;

    /* Idle CPU */
    _gotoCPUIdle_();
    }

    application code :
    EnterPrivilege();
    systemPowerDown(SYS_SLEEP_MODE);


    GIO Highleveintterupt detected, could not wake-up!
  • Hello,

    In your code, all the clock sources and domains are disabled. OSC or HP LPO are suggested as the wakeup clock source for Doze, snooze and sleep.

    You set the flash banks to sleep, but the flash pump is still active. Using flashWREG->FPAC1= 0 to take the pump to sleep.

    Can you show us the wakeup code?

    Regards,
    QJ
  • my new power down code:
    void systemPowerDown(uint32 mode)
    {

    /* USER CODE BEGIN (26) */

    flashWREG->FBAC = 0x00000000U
    |(uint32)((uint32)15U<< 8U) //BAGP
    |(uint32)((uint32)15U); //VREADST

    /** - Setup flash bank power modes */
    flashWREG->FBFALLBACK = 0x00000000U
    | (uint32)((uint32)SYS_SLEEP<< 14U) /* BANK 7 */
    | (uint32)((uint32)SYS_SLEEP << 2U) /* BANK 1 */
    | (uint32)((uint32)SYS_SLEEP << 0U); /* BANK 0 */


    flashWREG->FPAC2 = 0x0;
    flashWREG->FPAC1 = 0; // Take Pump to Sleep


    /* USER CODE END */

    /* Disable clock sources */
    systemREG1->CSDISSET = mode & 0x000000FFU;

    /* Disable clock domains */
    systemREG1->CDDIS = (mode >> 8U) & 0x00000FFFU;

    /* Idle CPU */
    _gotoCPUIdle_();

    /* USER CODE BEGIN (27) */
    /* USER CODE END */

    }
    init VIM code (a littel code)
    vimREG->WAKEMASKSET0 =0xFFFFFFFF;
    vimREG->WAKEMASKSET1 =0xFFFFFFFF;
    vimREG->WAKEMASKSET2 = 0xFFFFFFFF;
    vimREG->WAKEMASKSET3 = 0xFFFFFFFF;


    GIO interrupt code , I think when GIO interrupt deceted , the program go on .
    void gioNotification(gioPORT_t *port, uint32 bit)
    {
    /* enter user code between the USER CODE BEGIN and USER CODE END. */
    /* USER CODE BEGIN (19) */

    if (gioPORTA == port) {
    if(2 == bit) {
    qca_notification(gioGetBit(port, bit)); //application code
    } else if (5 == bit) {
    evcc_auxiliary_notification(); //application code
    } else {
    //do nothing
    }
    }
    /* USER CODE END */
    }
  • Hello,

    You can not disable the clock source and clock domain for wakeup. This is a example to enter Doze.

    void Doze()
    {
    Flash_Sleep();
    systemREG1->GHVSRC = 0x00000000; //OSC
    systemREG1->VCLKASRC = 0x00000000; //OSC
    systemREG1->RCLKSRC = 0x00000000; //OSC

    // All clock Domains are disabled except RTI
    /** @b Initialize @b Clock @b Tree: */
    // Write to Clock Source Disable Register -
    systemREG1->CSDIS = 0xFE; // disable all clock sources except OSCIN which is used to wakeup

    /** - Disable / Enable clock domain */
    systemREG1->CDDIS = 0x0 //RTICLK is enabled for wakeup
    | (uint32)((uint32)1U << 0U ) /* GCLKOFF */
    | (uint32)((uint32)1U << 1U ) /* HCLK OFF */
    | (uint32)((uint32)1U << 2U ) /* VCLKP OFF */
    | (uint32)((uint32)1U << 3U ) /* VCLK2 OFF */
    | (uint32)((uint32)1U << 4U ) /* AVCLK 1 OFF */
    | (uint32)((uint32)1U << 5U ) /* AVCLK 2 OFF */
    | (uint32)((uint32)1U << 8U ) /* VCLK3 OFF */
    | (uint32)((uint32)1U << 9U ) /* VCLK4 OFF */
    | (uint32)((uint32)1U << 10U) /* AVCLK 3 OFF */
    | (uint32)((uint32)1U << 11U); /* AVCLK 4 OFF */

    asm( " NOP");
    asm( " NOP");
    asm( " NOP");

    // Execute ARM instructions with IDLE cycles to trigger CPU clock stoppage
    asm( " WFI");
    asm( " NOP");
    asm( " b #-8");
    asm( " NOP");
    asm( " NOP");
    asm( " NOP");
    asm( " NOP");

    }

    Regards,
    QJ
  • If I want to GIO wake-up, when I deceted GIO interrupt, what I do?
    Now , I can use your code to Doze,but can not wake -up.