Workaround for “Cannot find an ST-LINK” when Using STLinkReflash for J-Link OB Conversion

In a hurry? Jump to the solution.

I was bringing up a new Nucleo-L4R5ZI board for one of my internal projects. I had trouble flashing the device using the opensource stlink command line tools. Rather than wasting too much time diving into that (apparently long-standing) issue, I decided to boot up my Windows VM and convert the onboard ST-Link into a J-Link using Segger’s STLinkReflash program.

Strangely, STLinkReflash couldn’t detect my board:

ERROR: Cannot find an ST-LINK, multiple ST-LINKs plugged in, or ST-LINK is in use.

So instead of wasting my time debugging the errors I was seeing with st-flash, I spent an entire morning trying to figure out why my ST-Link couldn’t be detected!

Debugging Summary

First thing – I checked to make sure I had the correct (and latest) drivers installed. I also manually uninstalled the drivers and re-installed the latest versions just to make sure. No change there.

I also noted the STLinkReflash version for future reference, in case an update comes in the future:

STLinkReflash Compiled Aug 12 2019 10:30:05

I pulled out two other Nucleo boards that I have on hand to see if this was an isolated problem. One of them was successfully re-flashed, but the other board triggered the same error. Obviously the re-flash tool itself works, somehow this was board dependent.

Then I figured it might be a firmware version problem. Of course, it’s always good to update to the latest firmware version when you run into trouble. I downloaded the latest ST-Link firmware update tools. What immediately jumped out at me is that the update tools had no problem detecting these ST-Link boards, but STLinkReflash definitely did.

Of course, I had to stop at this point and read the manual. I checked Segger’s website and confirmed that all of my boards were supported by the STLinkReflash tool. No obvious notes were found on the internet for this issue. There were no real requirements other than “install all of the necessary drivers before using this tool.”

Thinking this might have something to do with the firmware version itself, I reverted my “working” board back from a J-Link to an ST-Link so I could try updating that board. The version restored by J-Link was. definitely older than the currently available versions. I updated this device to use the latest firmware, and now it was in the “Cannot find an ST-LINK” camp.

Luckily, ST provides older versions of the firmware upgrade tools on their website. I went through them all.

The following versions did not play nicely with STLinkReflash in my setup:

  • 2.37.26
  • 2.36.26
  • 2.35.26
  • 2.34.25
  • 2.33.25

However, the oldest version currently available does work: 2.32.22!

Two out of the three boards I had on hand were able to downgrade straight from 2.37.26 to 2.32.22. However, one board was never successfully detected by the 2.32.22 update program, so I had to perform a two-stage downgrade process. First, I reverted to 2.33.25, then I reverted to 2.32.22.

At this point, I sent Segger a note about this issue with my findings. The Segger team responded:

We are not aware of any issues with recent versions of the ST-Link firmware + SEGGER STLinkReflash utility. We will check if we can reproduce this behavior. If reproducible, we will of course investigate and fix it if required.

They later wrote to confirm that they could not reproduce this issue. Segger noted the software versions they tested against:

  • Latest version of the ST-Link Reflash Utility (2019–08–12)
  • Latest ST-Link USB drivers: https://www.st.com/en/development-tools/stsw-link009.html
  • Latest ST-LINK firmware upgrade: https://www.st.com/en/development-tools/stsw-link007.html
  • J-Link software V6.86d
  • Windows 10 (x64)
  • Evalboard NUCLEO-F767ZI
  • Evalboard NUCLEO-L4R5ZI

There’s definitely a possibility that something is off with my setup, or that a Windows 10 VM inside of Parallels running on MacOS has some impact on the bug. Either way, I wanted to note my findings in case anyone else runs into this issue.

The Solution

First, confirm that you have installed the latest J-Link software package (V6.86d at the time this article was written), in addition to the ST-Link USB drivers. Try to upgrade your device once more.

If you’ve installed these components but still cannot upgrade your device, downgrade your firmware:

  1. Download version 2.32.22 of the stsw-link007 software package from the ST website (found in the “Previous Versions” dropdown)
    1. I’m mirroring the file just in case it disappears before Segger gets the problem resolved
  2. Unzip the archive and load the proper program for your OS
  3. Update (aka downgrade) your ST-Link firmware to version 2.32.22
    1. If your device isn’t detected by the update program, try reverting to 2.33.25 first.
  4. Close the ST-Link update program (important!)

And then run STLinkReflash to upgrade the device to a J-Link.

I’ve observed that sometimes STLinkReflash crashes suddenly during the upgrade process when talking with firmware version 2.32.22. If this occurs, just re-open the app and re-run the upgrade process. I have not seen it crash the second time.

11 Replies to “Workaround for “Cannot find an ST-LINK” when Using STLinkReflash for J-Link OB Conversion”

  1. I have the same problem with NUCLEO-STM32F429ZI and cannot find any way to get back to ST-Link. I have tried all versions ST-LinkUpgrade. I cannot recommend anybody to try onboard J-Link.

  2. Just to double check – did you install the J-Link drivers and the J-Link tools? I also found that the tools seem to install another driver that helps the process.

  3. Thanks, I was with it and thanks to your tutorial I managed to convert. You helped a person on the other side of the world because I’m Brazilian

  4. Thank you for this. I had exactly the same problem with a NUCLEO-L476RG. It had previously been converted to J-Link and I converted it back to ST-Link. That process was something of a pain and I had to go through some rounds of messing around before it was recognized by STM32CubeProgrammer. It seems that process got it updated to the latest ST-Link firmware, which means it was no longer recognized by the reflash utility.

    I’m not really sure what Segger is talking about in their response. It definitely seems related to the ST-Link firmware version.

  5. Thank you! The newest version of jlink now couldn’t connect to the converted ST-link (Jlink). I tried the old Jlink version as you mention and it works for me.

  6. Are you on a windows device? I am trying to downgrade my J-Link version to V6.86 on linux and it is not working for me.

  7. I had the same problem with ST-Link V2. The “issue” was that I converted the ST-Link firmware from “STM32 Debug+Mass storage+VCP” to “STM32 Debug+VCP” a while back. After converting it back to “STM32 Debug+Mass storage+VCP” with the latest ST-Link Upgrade Tool (V3.16.9), the ST-Link reflash tool was able to detect the ST-Link device. Not sure why that works but it solved the problem for me …

  8. I had the same problem with stm32f0discovery. Segger simply doesn’t want to solve the problem since it’s a free feature.
    Thx for mirroring the file 2.32.22. If you still have 2.33.25, It would be great if you shared it, because the oldest version on the st site is 2.36.26.

Share Your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.