Skip to main content
Associate
December 15, 2023
Question

Target disconnected error

  • December 15, 2023
  • 2 replies
  • 3605 views

Hi.

I have recently encountered a problem that I'm not capable of solving in for a few hours now.

I'm using STM32F042K6T6 as a uC and, when I try to debug my projet, it shows me the following errors:

Failed to execute MI command:
target remote localhost:2331

Error message from debugger back end:
Remote communication error. Target disconnected.: No error.
Failed to execute MI command:
target remote localhost:2331

I'm trying to fix those problems for a few hours, but with no succes.

Can someone help me solve me this?

Also I'm using J-LINK as a debugger.

Best regards

 

    2 replies

    Rim LANDOLSI
    ST Employee
    December 15, 2023

    Hello @ItzNicolo and welcome to the community,

     

    Could you, please, provide the debug configuration and the GDB server log? This will help us to analyze the problem further. Also, check that the J-Link is correctly connected to the board. This knowledge base link may help.

     

    Thanks,

    Rim

    ItzNicoloAuthor
    Associate
    December 15, 2023

    Ok, here is my debug configuration:

    For GDB Connection Settings:

    1. Autostart local GDB server

    2. Host name or IP address: localhost

    3: port number: 2331

    My Debug Probe is SEGGER J-LINK

    For GDB Server Command Line Options:

    1. Interface: SWD

    2. Initial Speed: 4 MHz without specific J-LINK S/N

    3. Device: STM32F042K6T6

    4. Reset strategy: Type 0: Normal

    5. JTAG Scan Chain: Auto with no position and IRPre

    For Serial Wire Viewer:

    1. Core Clock is disabled

    2. Limit SWO clock is disabled

    3. RTOS Kernel Awareness is disabled

    For Misc

    1. No script file used

    2. Live expressions and Flash download verification are enabled

    Associate III
    January 16, 2025

    What ended up being the solution for this error message?

    ItzNicoloAuthor
    Associate
    January 17, 2025

    I don't know. I just restarted the app and the error message disappeared.