Please do not post the same problem to multiple forums, at least not with mentioning that so that duplicated answers are avoided.
To check:
- do you handle or disable the COP?
- is the reset vector set?
- check write once registers, with the debugger they can be written multiple times but not in normal modes.
Daniel