Content originally posted in LPCWare by nerd herd on Wed Dec 17 16:27:00 MST 2014
Hi Chris,
As TheFallGuy's link mentions, there are several reasons why this may happen. The long story short is that your code likely puts the MCU into a state where the debugger is no longer able to communicate with the MCU. Booting the MCU into ISP mode is a great "catch all" solution for issues involving user code as it puts the MCU into a communicable state and avoids user code all together. After entering ISP mode, it is a good idea to erase the flash with a program such as Flash Magic and see if the issue persists.