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.

RARE CPU CRASH - MSP430G2352

Hello I hope someone can provide help. I have a board (inserted inside a plastic/metallic box) 
equipped with a MSP430G2352. The board is battery supplied with a CR2032 (like a sort of
 remote control) and the cpu is always in LPM4 and wakes up with the touch of button 
(buttons have plastic plug), no external oscillator connected to the cpu, wdt enabled. 

Very rarely (say 2 time in 3 months of test) users experienced a complete block of the 
board with the mcu not responding to the buttons pressure. The only way
 to wake it up was to unplug the battery and then press a button and then plug in the battery
 keeping the button pressed (only removing the battery didn't wake it)

How can this block be possible if the watchdog is enabled? 
 Which could be the causes of the block and how to prevent it?

Any suggestion would be very appreciated. Best regards, KK
  • The only thing I can think of is that  some of your memory locations (RAM and SFR) are getting corrupted somehow.

    You don't say what kind of a button your using.  If it is a common push button though, have you taken care to debounce it in your code?  What your seeing might be due to your push button bounce causing something like a stack overflow from time to time, in turn causing your program to "run away."

  • The interesting part is that you have to press the button before inserting the battery again.

    It looks like the MSP goes into low power mode somehow. And with its low power usage, it may live on the energy stored in a blocking capacitor, so when you remove the battery, it will survive for minutes or hours wihtout a power-on when you re-insert the battery. Pressing the button will drain the stored energy, so VCC really falls below brownout threshold.

    So why does the MSP enter LPM? LPMs are entered by setting specific bits in the processor status register. This register is stored to stack when entering an ISR and restored when leaving. If during an ISR a stack overflow occurs (especially when nested ISRs are used, that means GIE is set inside an ISR to allow other ISRs to interrupt), then the status register is written into the void, and on ISR exit, something is fetched from the void into the status register, possibly entering LPM.

    Also, when writing to an array and writing out-of-bounds for some reason (maybe a bad exit condition check for the index variable), the write may overwrite the stack and cause similar problems. It may alter the return address for the current function too, and cause the PCU to jump into the void, probably into data space, trying to execute data as code. Which also includes the possibility to execute code that loads random data into the status register, making the MSP enter LPM.

    With other data in memory, it may be that the MSP is simply rebooting due to an illegal operation. And you never noticed since the device is operable again soon after.

**Attention** This is a public forum