Debugging with LPC-Link2 hangs intermittently

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debugging with LPC-Link2 hangs intermittently

812 Views
bennxp
Contributor III

I have a custom board with an iMXRT1064. I'm using the LPC-Link2 to debug over the SWD port, I'm able to successfully run the debugger, step through the program, etc with MCUExpresso. However, if I run debugger long enough, it loses the connection to the MCU. Here is my test code:

int main(void) {
    customInit();
    int loop=0;
    while(true) {
        int result = doSomething();
        printf("Got result of %d on loop %d\r\n",result,loop);
        toggleLED();
        loop++;
    }    
}

Sometimes my loop runs for tens of thousands on iterations. But eventually my program and my debugging connection crash. The LED does not toggle, I no longer get print lines to the console and in MCUExpresso, when I try to pause or stop the debugging, these errors pop up:

Failed to execute MI command:
-interpretor-exec console kill
Error message from debugger back end:
Can't kill process

and

Target reported errors (click 'cancel' to terminal session)
Reason:
  19: Could not stop execution from running
  Wire ACK Fault in DAP access
  Debugging context: test_code LinkServer Debug

If I run the program without debugging (just reboot since debugger writes to the flash), the program never crashes and the LED always toggles.  Sometimes restarting MCUExpresso and disconnecting and reconnecting the LPC-Link2 seems to help get the code to run longer, and some tweaks to the code in doSomething() seems to make the crashes more or less frequent, but whenever I narrow in on something, it changes. 

What could be going on and how I can troubleshoot and fix this?

 

0 Kudos
2 Replies

777 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @bennxp ,

Could you follow this guide to reflash the LPC debugger? 

Best Regards,

Alexis Andalon

0 Kudos

799 Views
MikeCalm
Contributor II

Hi, I have exactly the same issue with standard development kit QN9090-DK6.

 

Hope someone can help.

0 Kudos