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.

TMS570LS1224: Low Power Mode - CAN issue

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Dear TI Team,

I am working on Low Power Mode. I am able to switch to Low Power Mode and get back to normal operation using RTI and/or GPIO.

Now I am going to use CAN bus in my project. During program is running I would like to have possibility to use CAN as wake up signal or not to use CAN as wake up signal. I suppose it it should be done by changing vimREG->WAKEMASKSET0, but it does not working. Below you will find my code and results:

1. I am trying to not use CAN signals as wake up signal.

/* canREG1->CTL after init phase: 0000 0000 0000 0011 0001 0110 0000 0010b */
/* Status Change Interrupt is disabled */

/* Wakeup Interrupt: RTI compare 0 */
vimREG->WAKEMASKCLR0 = 0xFFFFFFFF;
vimREG->WAKEMASKCLR1 = 0xFFFFFFFF;
vimREG->WAKEMASKCLR2 = 0xFFFFFFFF;
vimREG->WAKEMASKSET0 = (1U << 2U) /* RTI CAP0 */
                     | (1U << 23U); /* GPIO Low */

In this approach, I am using both RTI and GPIO wake up signals. Its few seconds in normal operation mode and few seconds in Low Power Mode (Doze). In canMessageNotification() I am using canTransmit() to send echo message. When I send CAN message (from second MCU) during Low Power Mode it stays there forever. I do not know why RTI do not wake up mcu any more. 

2. Second try, WAKEMASKSET0 still without CAN, but now Status Change Interrupt is enabled.

/* canREG1->CTL after init phase: 0000 0000 0000 0011 0001 0110 0000 0110b */
/* Status Change Interrupt is enabled */

/* Wakeup Interrupt: RTI compare 0 */
vimREG->WAKEMASKCLR0 = 0xFFFFFFFF;
vimREG->WAKEMASKCLR1 = 0xFFFFFFFF;
vimREG->WAKEMASKCLR2 = 0xFFFFFFFF;
vimREG->WAKEMASKSET0 = (1U << 2U) /* RTI CAP0 */
                     | (1U << 23U); /* GPIO Low */

In this approach, When I send CAN message (from second MCU) during Low Power Mode it immediately wake up and switch to normal operation. I do not know why because WAKEMASKSET0 is not configure for that.

I also have tried Global Power-Down Mode described in TRM (SPNU515C–March 2018, 27.11).

"...it can be active, if enabled". In my case it seems to be active. But how can I disable it? 

Could you help, please?

  • Hello,

    Sorry for the delay. Your question was addressed but our expert is OOO. He will answer as soon as possible.

  • I hope Expert is available now :) Could somebody help?

  • Hello,

    Sorry for reply so late

    What happened if you enable the CAN wakeup in  vimREG->WAKEMASKSET0?

     vimREG->WAKEMASKSET0 = (0x1 << 16);  //CAN1

  • Hello,

    I enabled CAN1 High:

        /* Wakeup Interrupt: RTI compare 0 */
            vimREG->WAKEMASKCLR0 = 0xFFFFFFFF;
            vimREG->WAKEMASKCLR1 = 0xFFFFFFFF;
            vimREG->WAKEMASKCLR2 = 0xFFFFFFFF;
            vimREG->WAKEMASKSET0 = (1U << 2U)   /* RTI CAP0 */
                                 | (1U << 23U)  /* GPIO Low */
                                 | (1U << 16U); /* CAN1 High */

    When I send CAN frame from external source and my MCU is in sleep mode it wakes up immediately (and it does not matter if message ID was specified in HalCoGen or not. Every message on CAN bus breaks sleep mode and controller wakes up.

    Before I enter low power mode I also tried power down CAN peripheral (code below) but I do not noticed any changes.

        peripheral_Frame_Select_t frameCAN1 = {PeripheralFrame_CS8, (Quadrant0 | Quadrant1)};
        peripheral_Frame_Powerdown_Set(frameCAN1);

    I would like to have possibility to turn off 'CAN wake up option' during operation. It is unwanted behavior when all traffic on CAN bus can wakes MCU up.

  • Hello Michat,

    Your observation is correct. The wake up options for sleep low power mode are GIO interrupt, CAN message, and SCI message. RTI interrupt is not able to wake up the device which is in sleep mode since the RTI clock is turned doff.

    As you observed, any kind of CAN message with any ID can wake up the device. All the wake-up interrupts (GIO, CAN, SCI) are ORed into a single wake-up signal to wake up the device.

    If the CAN module is in global power down mode (PSPWRDWNSET), and if CAN bus activity detection circuit is not activated (WUBA), the CAN bus message will not set the wakeup interrupt. If WUBA is activated, any CAN bus level activity (dominant CAN bus level) will generate wakeup interrupt, then your code can start the wake up sequence.