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.

F5419: FLL Problem when wakeup from LPM3 is very short



Currently I am porting an application from the F449 to F5419 and I recently discovered some strange behaviour I cannot explain. The code is very simple, it does basically what every MSP app does. Problem is now, that after running for 15-40Min, the processor seems to stop completely, or when I activate the WDT, it resets the system. What makes debugging even more complicated is the fact, that this effect does not occur with SBW attached and can be reprodruced on 1 board only. 2 other boards do not show the problem, so I first thought the problem was Hardware related.

The settings for UCS are:

UCSCTL6 = XT2OFF + XCAP_2 + XT1DRIVE_3;
UCSCTL4 = SELA__XT1CLK + SELS__DCOCLK + SELM__DCOCLK;
UCSCTL3 = SELREF__XT1CLK;         
UCSCTL1 = DCORSEL_5;
UCSCTL2 = FLLD_1 + 127;                 // DCO 8.4MHz

The main loop looks like this:

while(1)
 {
  _BIS_SR(LPM3_bits + GIE);
  _NOP(); 

  if (gIRQFlag == RTCFLAG)
  {
     UpdateTime();
  }
}

And the Interrupt Handler (RTC) simple wakes up the system:

__interrupt void RTCTimer(void)
{
if (RTCIV == 0x04)
 {
 gIRQFlag = RTCFLAG;
 }

_BIC_SR_IRQ(LPM3_bits); 
_NOP();
}

My first thought now was, that the power supply is instable, so I tried to force the problem by drawing more current with higher processor load - simply inserted a delay loop. But to my surprise, the problem disappeared completely. The board run for more than 12 hours without problems. The code of the main loop looked like this:

while(1)
 {
  _BIS_SR(LPM3_bits + GIE);
  _NOP(); 

 for (int t = 0; t < 30000; t++)
 {
  _NOP();
 }

  if (gIRQFlag == RTCFLAG)
  {
     UpdateTime();      // add 2 seconds (takes approx 20µs)
  }
}

After reproducing the effect 5 Times by changing code back and forth, I came to the conclusion, that the problem must have something to do with the short activity in Active Mode. The FLL came to my mind. I changed the interrupt handler, so that the FLL is disabled after wakeup:

__interrupt void RTCTimer(void)
{
if (RTCIV == 0x04)
 {
 gIRQFlag = RTCFLAG;
 }

__BIC_SR_IRQ(SCG1 + CPUOFF);  // wakeup with FLL disabled
_NOP();
}

Since then, all 3 boards have run without problems. And I am quite sure that testing of the next batch of prototypes will show no problems anymore, too. But still a bad feeling remains... production quantity will be more than >10000 units a year and product lifetime will be more than 10 years... so I have to be really sure that the problem will no longer come up.

My theory up to the moment is, that the FLL produces spikes from time to time under certain conditions. (Maybe when the DCO Tap changes?). Bug UCS4 comes to my mind. That reminded me of something from the F1xx series so to be sure I added a clock division: UCSCTL5 = DIVS_2 + DIVM_1; (DCO @16MHz now) to filter out the spikes (if any).

Any comments are really welcome, maybe somebody else has discovered something similiar?? At the moment I am really not sure if I can rely on the F5x FLL anymore...

Thanks for listening,
Johannes

  • Johannes,

    Thanks for the clear and detailed explanation. The case you have described maybe related to an issue that is currently under investigation for the 54xx family.

    Issue: Frequent interrupts when coupled with very short duration in active mode may result in FLL instability. The workaround for this is to insert a delay (as you have already mentioned). The minimum delay that the FLL needs to lock onto the reference is 3 * (1/t (refclk) where REFCLK = 32768 Hz. 

    With the processor running @ 8MHz the delay works out to 3* (1/32768) = 91us =  ~ 730 MCLK cycles.

     A few of the following checks will help us isolate the issue better:

    (1) Do not enable the WDT

    (2) Monitor MCLK on a port pin. You can also toggle a port pin in parallel to indicate LPM entry and exit. What happens to the MCLK when the device is active?

    Does removing/ inserting the delay cause a change in behavior?

    (3)  Repeat the same experiment with the FLL disabled/enabled. Does MCLK output change?

    Please verify the above and post the follow-up so we can proceed further.

    Regards,

    Priya

     

  • Thank you for your answer. Yep, I think that is the same problem. But I would not call Interrupts at a rate of 0.5/s "frequent" - In my application there are long times (sometimes weeks) where only the time has to be updated, so I think the problem is just the number of times the system wakes up without the possibility to lock the FLL.

    I already started some measurements, could not record a crash until now. Unfortunately we "forgot" to put testpads for MCLK on the board (all we needed until now was ACLK...), so I hooked the LA to SMCLK (P4.7) and triggered for a logic 1 with duration < 110ns (high pulses should be 119ns @4MHz). After approx 20min the LA recorded a squence immediately after leaving LPM3:

    Lo: 100ns
    Hi:  106ns
    Lo: 102ns
    Hi:  102ns
    Lo: 102ns
    Hi:  108ns
    Lo: 104ns

    After around 20 Cycles the pulses stabilize around 118ns (end then my recording ends). So all I can tell at the moment is, that it seems that the DCO is sometimes a little fast when leaving LPM3.

    Hopefully I can record the crash later this day, but problems always don't like to get hunted...

    Regards,
    Johannes

  • After having the board attached to the LA for more than 15h now, all I could record were 6 another sequences like the one already described above. No crash anymore. To make things even more mysterious, after I started measuring ACLK on P11.0, even this sequence no longer occured... I still wonder why... not much has changed. Maybe voltage dropped some mV (used battery) and room temperature dropped a little bit since begin of my tests.

    Well, there are already known workarounds for this problem, so it is not the big deal and I will stop here. Leaving LPM3 with FLL disabled on RTC interrupts seems to werk very well. To be really sure, I will add some 60µs delay loop, the energy used by that is really neglebible.

    Regards,
    Johannes
     

  • Just discovered that I used the wrong source files... version control has overwritten one of my last "play" versions. And now finally, I could see what happens:
    The crash is a very slow process. With every Interrupt, the DCO frequency increases a little bit, until at a SMCLK frequeny of 15.38MHz, the processor finally stops (which means at this point MCLK is 30.76MHz [:O] - overclockers will like this...).

    I still do not know, why the other boards do not show this, ACLK seems to be stable.
    Hope this helps to figure out the final reason. But as I said: Nothing to worry until then, you only have to know for the workarounds.
    Regards,
    Johannes

**Attention** This is a public forum