Skip to main content
Visitor II
September 5, 2024
Question

unable to connect STM32F072RBT6 via stlink (usb cable )

  • September 5, 2024
  • 3 replies
  • 2027 views

Hi Team,

 

ST-Link Connection Issues with STM32F072RBT6 Discovery Board

Hi everyone,

I’m experiencing issues with my STM32F072RBT6 Discovery Board. It was working fine until recently when I started encountering errors with the ST-Link debugger.

Error Details:

  • During Debug Mode: The debugger displays the error message "TARGET HALT" and disconnects.
  • Flashing Code: When trying to flash the code, I receive the error "Debugger Disconnected."
  • STM32CubeProgrammer: I also get a warning message saying "Connection to device 0x448 is lost," followed by "Disconnected from device."

I have attached screenshots of the errors for reference.

Steps I Have Tried:

  1. Verified hardware connections.
  2. Reset the STM32 board.
  3. Updated ST-Link firmware.
  4. Checked STM32CubeProgrammer and STM32CubeIDE settings.
  5. Confirmed stable power supply.
  6. Looked for hardware issues on the board.
  7. Attempted a full chip erase via STM32CubeProgrammer.

    PFA (images)below including stm32cubeprogrammer logs.

Despite these efforts, the issue persists. Any advice or suggestions on how to resolve this problem would be greatly appreciated. Thank you!

Best regards,
Sudharshan 

    This topic has been closed for replies.

    3 replies

    Super User
    September 5, 2024

    So it's losing connection to the device.

    Does your application put the CPU to sleep, and/or disable or reconfigure the SWD pins?

    Visitor II
    September 5, 2024

    Hi,

    The application/code doesn't put the CPU to sleep .  The flashing or debugging is using a ST-Link (a USB wire). In STM32CubeIDE , during debug mode , i am facing this issue . Could you explain the disable  or reconfigure the SWD pins mean here ?

    Thanks

    Sudarshan

    Super User
    September 5, 2024

    @Sudharshan wrote:

    Could you explain the disable  or reconfigure the SWD pins mean here ?


    The SWD lines (SWDIO and SWCLK) are on PA13 and PA14:

    AndrewNeil_0-1725532926891.png

    So, if your code does anything to PA13 and/or PA14, it will break the debug connection.

    https://community.st.com/t5/stm32-mcus/how-to-solve-debugger-connection-issues/ta-p/49693

     

    Super User
    September 5, 2024

    Maybe hold BOOT0 high during reset, then connect over SWD with STM32CubeProgrammer.

    Graduate II
    September 5, 2024

    Bad USB cable? 

    Super User
    September 5, 2024

    @Karl Yamashita wrote:

    Bad USB cable? 


    The screenshots suggest that it does initially make connection, but then loses it.

    So could be a faulty USB cable with intermittent fault.

    Maybe broken/loose USB connector on the Discovery Board - they are not the most robust things ...