Hi David,
Thanks for your response.
I used one of the example projects to develop the code and it has been working normally all the time.
I solved the issue it is actually the debugger cable connecting to the board is loose.
Once again Thanks for the support,
Raju