ST-LINK error on STM32CubeProgrammer: Problem occurred while trying to connect

11.4k Views Asked by At

On STM32CubeProgrammer trying to connect to ST-Link module on STM32H7B3LI, I get this:

ST-LINK error (DEV_CONNECT_ERR)
Error: Problem occurred while trying to connect

I already tried installing the firmware here but it doesn't help: https://www.st.com/en/development-tools/stsw-link007.html

Update: I had skipped a necessary step in the firmware install process. However, I wanted to connect because the board has been refusing to connect by other means due to software messing with power settings, and so there's another error:

  16:54:40 : ST-LINK SN  : 0035002E3438510534313939
  16:54:40 : ST-LINK FW  : V3J8M3
  16:54:40 : Board       : STM32H7B3I-DK
  16:54:40 : Voltage     : 3.28V
  16:54:41 : ST-LINK error (DEV_CONNECT_ERR)
  16:54:41 : ST-LINK SN  : 0035002E3438510534313939
  16:54:41 : ST-LINK FW  : V3J8M3
  16:54:41 : Board       : STM32H7B3I-DK
  16:54:41 : Voltage     : 3.28V
  16:54:41 : Error: ST-LINK error (DEV_CONNECT_ERR)

When software reset is selected:

  16:55:24 : ST-LINK SN  : 0035002E3438510534313939
  16:55:24 : ST-LINK FW  : V3J8M3
  16:55:24 : Board       : STM32H7B3I-DK
  16:55:24 : Voltage     : 3.28V
  16:55:24 : No STM32 target found!
  16:55:24 : ST-LINK SN  : 0035002E3438510534313939
  16:55:24 : ST-LINK FW  : V3J8M3
  16:55:24 : Board       : STM32H7B3I-DK
  16:55:24 : Voltage     : 3.28V
  16:55:24 : Error: No STM32 target found!
1

There are 1 best solutions below

0
On

I know this is an old question, but I had a similar problem, and I wasted 2 hrs solving it on Linux...

There are 2 potential causes for this:

  • Problem with a physical connection
  • Missing udev rule

Udev rule

What I found is that STM32CubeProgrammer is not adding the udev rules necessary for the controller...

From this post: https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer#Preparing_the_USB_serial_link_for_flashing

#Install libusb 
sudo apt-get install libusb-1.0-0  #For debian distributions

#Get udev rules from the STMCube
cd <your STM32CubeProgrammer install directory>/Drivers/rules
sudo cp *.* /etc/udev/rules.d/

#reload udev rules
sudo udevadm control --reload-rules

This worked for me on STM32CubeProgrammer 2.8.0 under Ubuntu 20.04, I hope it helps someone.