This happens if an interrupt fires that you don't have implemented in the code. You can look at VECTACTIVE register field somewhere in SCB registers to see what interrupt fired.
If you feel a post has answered your question, please click "Accept as Solution".