Hi, I am working with some legacy code at the moment on a MSP430FG4618 and I am changing several features. Up until now I haven't had any problems. Recently however I am encountering a very strange issue. When the code is running I am seeing an unintentional function call. The function in question loads default values into all of the register of the register map with hard coded values, and as you can guess this is a major problem. This function can be called intentionally if the user goes into the default page and selects this option. It can also be called intentionally if the uC boots up and there are no values already in the register map i.e. boot up after first time it has been programmed. My issue is that it appears that this function is being called unintentionally. I left a unit in a locked location (to rule out tampering by another user) and when I returned the default values were loaded somehow. Given that I left this unit on and the registers had data already in them, and it wasn't on the default page this function call can't have been caused by either of the intentional methods. Somehow the default function has been called unexpectedly.
My colleagues suggest that I place advanced trigger points at the locations in memory where this function resides along with the locations in memory from where it can be called and wait for a break to happen, which I have done. The problem is that it can take a while for this to happen so I have to sit here at my computer waiting for a break at which point I could analyse the stack to see where this was called from.
In the meantime does anyone have any suggestions as what is likely to be the cause of this? Are there any particular things I should be looking at in my code i.e. stack problems or memory overflows? Also, are there any better ways of debugging this issue rather than waiting for a break from the advanced triggers?
Any help would be appreciated and if you require anymore information please ask away. I am new to this so I may not have included the necessary information needed to answer this question.