cancel
Showing results for 
Search instead for 
Did you mean: 

Linux cannot set up ST-Link

jindo85547
Associate III

Hello,

I am trying flash my STM32F746G Discovery board with new code from Linux. I run into this issue after running "dmesg -w": "can't set config #1, error -32". ST-Link is not being detected by either STMCubeIDE and STMCubeProgrammer. Has anyone run into this issue before?

Furthermore, I had code flashed to the Discovery board that had a screen show, but I am met with a black screen when I connect it to power. The LED next to the ST-Link flashes red. I've also tried changing my debugger from ST-Link to SEGGER, but I met with the error "Could not determine GDB version using command: arm-none-eabi-gdb --version," and I am currently looking into this. 

I'm hoping that this is not a board issue but rather a software issue, but at this point it seems like this may be a board issue.

Regardless, has anyone had any issues like this, and can provide any tips on what to do from here?

1 ACCEPTED SOLUTION

Accepted Solutions
jindo85547
Associate III

I had tried 2 wires before making this post. I tried a third out of desparation. The ST-Link is detecting.

To everyone who responded to this post, I am thankful and also sorry that I ended up wasting your time.

I learned a lot from those who responded, thank you again. 

View solution in original post

11 REPLIES 11
krotti42
Associate III

@jindo85547 wrote:

Hello,

I am trying flash my STM32F746G Discovery board with new code from Linux. I run into this issue after running "dmesg -w": "can't set config #1, error -32". ST-Link is not being detected by either STMCubeIDE and STMCubeProgrammer. Has anyone run into this issue before?

[...]

udev rules setup correctly?

AScha.3
Chief III

Hi,

after plug st-link to a usb, you should see on dmesg output:

AScha3_0-1738490282352.png

If nothing - take another cable+port , if on not-just-charger cable no st-link found . its defective.

+ Try on other PC/Labtop...to be sure.

If you feel a post has answered your question, please click "Accept as Solution".

Hello,

I get most of that output, but after the manufacturer details I get  "can't set config #1, error -32". I will try this on a different laptop and get back to you later today. 

I've not looked into this yet, I'll try this later today and get back to you. 

afair error -32 : i seen on defective USB sticks and hubs (- reset , not responding.) ....

If you feel a post has answered your question, please click "Accept as Solution".
jindo85547
Associate III

I've just tried plugging the ST-Link into a Windows machine, but the ST-Link is not detected there either. This is probably more indicative of a board malfunction, no?

 

Hello,

I looked into this suggestion and tried to configure the udev rules with this post as a guide. https://community.st.com/t5/stm32cubeprogrammer-mcus/error-connecting-with-st-link-in-linux/td-p/691415

The ST-Link still doesn't appear in lsusb nor dmesg. 

I am going to check the pins on the ST-Link using a multimeter to check for a short circuit. 

Ozone
Lead II

Does the ST-Link show up in the lsusb output ?

> I've also tried changing my debugger from ST-Link to SEGGER, but I met with the error "Could not determine GDB version using command: arm-none-eabi-gdb --version," and I am currently looking into this. 

I can't quote the actual groups names from memory, but you additionally need to add your user to the group allowed to access such USB devices. Use your favourite search engine.

As a side note, I have most of my onboard ST-Links converted to JLinks (with Segger's firmware), since I use their Embedded Studio IDE under Linux.

Hello,

I tried adding my user to group dialout, but I was told in terminal that I was already in that group.
I checked the voltage across the power pins of the ST-Link (Pins 1 and 4 according to this link https://www.st.com/resource/en/user_manual/um1907-discovery-kit-for-stm32f7-series-with-stm32f746ng-mcu-stmicroelectronics.pdf pg 26/37) and I'm getting fluctuating values of DC Voltage around 0 volts (ranging from around 0 - 0.1 Volts).
I'm going to try to use one of the external ST-Links to debug.