Micro controller getting reseted periodically.


I am using Nuvoton M058LBN. In my code, my while 1 there are some functions which should run continuously. But it was getting reseted . So for checking I printed some statement which is getting printed 10 times after which it stops printing and restarts the controller.

So the possibilities I thought is it might be because of some interrupt but how can it be so periodic. Can anybody please help me with this? How can I check the cause of reset? I am not able to understand why it is getting reseted. Sorry if you find this question silly.

Thanks in advance.