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.

TMS470 doze mode

Other Parts Discussed in Thread: HALCOGEN, UNIFLASH

Hi,

I'm trying to implement Doze mode on the TMS470M(F06607) but am struggling to nail it down.

Using an initial HALCoGen base, all clock sources are set to the OSC at 16Mhz (no PLL engaged).

The software is an interrupt-based loop. Initial implementation just called "WFI" after each pass of the loop, which works fine, but extending this implementation to full doze, following section 2.2.2 of the RM, seems to put the device into a permanent catatonic state which proves difficult to recover from!

The code to enter Doze Mode consists of:

flashWREG->FBFALLBACK = 0;

flashWREG->FPAC1 &= ~(0x01);

systemREG->VRCTL = 0xF0;

systemREG->CSDISSET = 0x0E; //OSC on, PLL off, 32khz off, ext clk off, LPO's on

systemREG->CDDISSET = 0x3F;

 asm(" wfi");

Once the device enters Doze, the debugger looses connection and the device then fails to wake from interrupt source. I have two sources of interrupt available: GIO (which scope confirms it drops to a LOW level) and DCAN1. These interrupts work fine when the device is in active mode.

Unfortunately, once the device has dozed, the only recovery is with a timed Uniflash Erase coupled with holding the reset. I've already lost one board to 'infinite doze' whereby it couldn't be recovered, hence I've lost my nerve a little and am seeking advice! FYI comment out the VRCTL statement above if you want to permanently kill your device!!

Anyone any ideas what I've done wrong in the implementation above?

cheers

Mat

  • Hi Mat,

    A couple of comments:

    The VRCTL register needs to be configured to 0x0F instead of 0xF0. You also need to configure the VIM to enable generation of a wake up signal for the corresponding interrupt request from GIO and/or DCAN1.

    The debugger will lose the connection as the clock to the CPU is disabled.

    Regards, Sunil

  • Thanks Sunil,

     Just to confirm, the VIM registers for enabling wakeup are these four:

     vimREG->WAKEMASKSET0 = 0xFFFFFFFF;
     vimREG->WAKEMASKSET1 = 0xFFFFFFFF;
     vimREG->WAKEMASKCLR0 = 0xFFFFFFFF;
     vimREG->WAKEMASKCLR1 = 0xFFFFFFFF;

    (and this setting will enable wakeup for anything and everything)?

    Mat

  • Mat,

    Obviously you need to only write to either the WAKEMASK SET or CLR registers. The registers should have been named "WAKE ENA SET" and "WAKE ENA CLR" respectively. You need to set the bit in the WAKEMASKSET register in order to enable the wake-up function.

    Each bit in these registers corresponds to the interrupt channel number. So yes, each interrupt condition can be also used as a wake up request. Just that once the clock domains are turned off in doze mode, the only possible interrupt conditions are from an RTI compare match (having first switched the RTICLK domain to a clock source that is not disabled), or from an asynchronous external input like a GIO pin or SCI RX or DCAN RX.

    Regards, Sunil

  • Hi Sunil,

    I've just made the modifications and given it another go. Alas, it is still in the same position: when just using "wfi" the interrupts correctly fire the processor out of idle, but as soon as I switch the clocks/vcore off, no wake-from-interrupt fires (from multiple sources).

    I'm sure this is just something silly in the implementation. Do you have any example HALCoGen-generated examples which show the use of Doze/Sleep modes for the TMS470?

    Mat

  • Hi Mat,

    See attached CCS project (zipped). You can use this as a reference.

    5857.LPM_Wakeup.zip

    Regards, Sunil

  • Thanks Sunil, that's exactly what I needed!

    Mat