Skip to main content
Visitor II
February 2, 2025
Solved

Linux cannot set up ST-Link

  • February 2, 2025
  • 5 replies
  • 2819 views

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?

    This topic has been closed for replies.
    Best answer by jindo85547

    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. 

    5 replies

    Visitor II
    February 2, 2025

    @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?

    Visitor II
    February 2, 2025

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

    Super User
    February 2, 2025

    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.

    Visitor II
    February 2, 2025

    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. 

    Super User
    February 2, 2025

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

    Visitor II
    February 4, 2025

    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?

     

    Explorer
    February 4, 2025

    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.

    Visitor II
    February 4, 2025

    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. 

    Explorer
    February 5, 2025

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

    Are the required udev rules in place, to allow access in general ?

    > I checked the voltage across the power pins of the ST-Link (Pins 1 and 4 according to this link ... and I'm getting fluctuating values of DC Voltage around 0 volts (ranging from around 0 - 0.1 Volts).

    Not sure what you mean.
    Like other debug pods, the ST-Link has the optional capability to supply +3.3V to the target.
    I would recommend to not try this in this case. You are dealing with a relatively large board with a LCD display here.

    Usually, both the ST-Link and the target are supplied from the ST-Link USB connection.

    jindo85547AuthorAnswer
    Visitor II
    February 5, 2025

    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.