This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

XC164 Random ILLOPA or UNDOPC Trap

Hi,

I am facing a strange behavior of my code.
If I write new code or add code to existing classes etc. the programm may cause an B-Trap IR. The TFR then says ILLOPA or UNDOPC. If I then add more code, the error disappears but it pops up again if I add even more and so on.
If tried to identify the code line where the error happen, but the stack doesn't contain any valid flash address when I break the programm inside the Trap-IF function.
The CSP is 0 and IP is something like 0x06 or 0x0A. Flashcode starts at 0xC00000.

I tried to debug the code to find the place where the error happens. Disassembly shows an write operation to the PSW register. The purpose is to do a IR-lock.
But what is strange again, if I set some breapoints around this place of code, the B-Trap won't trigger! I have to run the code from the start or set the breakpoint far away to trigger the error.

I also checked the user stack by filling the stack with a pattern so see how much of the stack is used. But there is plenty of space left.

Does someone have an idea or hint about this?