Other Parts Discussed in Thread: C2000WARE
I have an application that is working as expected when the CSM passwords are not set (all 0xFFFF), but when I do set the password to lock the flash, the system runs for less than a second, and then resets. I assume this is because some part of the code is accessing secured memory illegally. If I unlock the flash at the beginning of my application, and leave it unlocked, the processor does not reset unexpectedly.
Is unlocking the flash at the top of main, and never relocking it (besides the automatic locking that occurs on reset/power loss), defeating the purpose of locking in the first place?
Alternatively, what is a good strategy for finding the offending code that is causing this reset? I can run the debugger with the CSM passwords written, but it seems like a catch 22, because I need to unlock just to attach the debugger, and the problem only happens when locked.