Hi @sandeepc ,
Thanks for your interest in NXP MIMXRT series!
As mentioned in your referenced Knowledge Base article, this error occurs because when the flash memory contains an abnormal application (access memory not present, corrupted memory, incorrectly configured clock, etc.) it will cause the board to end up in an unknown state, and then the debugger will not be able to control the core. By clearing the flash memory in SDP mode, it allows the MCU to return to the correct location.
During your testing, the simplest HelloWorld project is used, but this fault occurs every time except the first debug. Is this a situation that could be considered a debugger problem? Suggest you use an external debugger or update/replace the firmware of the on-board debugger and try again next time after erasing the flash memory.
Best regards,
Gavin