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.

MSP430 failure after hours of operation, stack overflow?

Other Parts Discussed in Thread: MSP430F5507

Hi all,

Using: MSP430F5507 mounted to custom PCB

I am experiencing an issue that I assume is related to a stack overflow, but I am unable to find the source as of yet. The unit runs great for approximately 9.5 hours, then stops functioning properly. I am able to perform a reset on the MSP430 and the unit runs great for another ~9.5 hours before the battery is exhausted. The unit is sourced from a li-ion battery, the calculated and measured specs estimate a battery life of ~25 hours. My initial thought was to blame the battery, but sourced from CV power supply and the same issue appears.Also, because of the consistency of the issue I assume the problem to be related to a code issue.

I have been dissecting the program, but because the issue only occurs every 9.5 hours its a slow task. I am hoping to get some ideas if there are any out there.

The code is written in C. Two interrupt routines are occurring; one is due to Timer A interrupting every 0.5 seconds and incrementing a volatile unsigned int  to keep track of time. The other is a USCI A1 interrupt communicating between the MSP430 and RF processor.

I have tried placing a watchdog timer that would reset the system if I was experiencing a lockup, but it did not help. Either the system is not locking up or the PC is lost? I was able to capture some information through the debugger after running for 9.5 hours, but unable to determine if it is relevant due to issues between the debugger and my custom PCB interface. Here is what I saw:

PC: 0x000000
SP: 0x0033E4
SR: 0x0000

In disassembly view:

Address: 0x000000  D032 00F0 Bis.W #0x00F0, ST
Address: 0x000004 3FFF              JMP (0x0004)
Address: 0x000006 0000              BRA @PC

Looking at the memory view:

Random locations were written to zero in the program code section, but this could be a side effect issue with code composer and my debugging interface.

My inclination is that I have an issue with one of the interrupt routines, so I will dig more into them. Please help if you see something.

Thanks for you time,