Stm32CubeProgrammer not connecting (no error msg) using ST-LINK V2 dongle and Lora E5 mini board

8k views Asked by At

I've tried countless settings in an attempt to program my stm32 board. The main tutorial I followed is https://wiki.seeedstudio.com/LoRa_E5_mini/.

I have connected a USB st-link v2 dongle to my laptop with pins SWDIO, SWCLK, GND correctly wired to the STM32 board.

For power the board is also connected to a usb port via its type c connector.

Serial comms over usb work, updating the st link firmware works and stm32cube programmer finds the st link device:

stm32cubeprogrammer

I now press the reset button, hold it, click on Connect, release the reset button after 3 seconds and then.. absolutly nothing happens and no error message appears.

I've tried the same thing with ST-LINK utility. When holding the reset button the LED on the st link dongle starts flashing, but whenever I release the button I get this:

enter image description here

I was not able to find the same issue on google, since everyone else is getting error messages if it doesn't work.

Has anyone run into the same problem? What part could be the issue?

7

There are 7 answers

1
Ted Mellin On

Feel you, i did exactly the same stuff, with the same hardware, and nada. got it writing CCCCCC fine to putty though.

3
Jarek On

You probably have a fake chip (no ST chip). Look at the picture.

enter image description here

I have the same problem. In my case the serial number is E and the trick with Shared enable does not work. Installing the old programmer STM32 ST-LINK Utility helped me. Also using this program the full serial number is visible.

enter image description here

1
Assay On

You can try the following suggestions. Some ST devices are a lot more sensitive than others when it comes to programming. I have had some ST devices programming without issues and then using practically the same setup on other devices it just won't work.

  1. Place a 22ohm resistor in series on the SWDIO and SWCLK lines. This link suggests only placing it on the SWDIO line but I found that I needed it on the SWCLK line as well. Typical SWD Circuit

  2. For the ST Link Settings try using these:

    • Reduce the frequency from 4MHz to a lower frequency
    • Use SWD
    • Use connect under reset
  3. Don't use an external pull-up on the NRST line. I have also found that using a 100nF Cap on the NRST line might affect the programming. Try programming without a NRST capacitor.

  4. Make sure that your programming wires between the ST-LINK and the target board are as short as is conveniently possible.

  5. (This one I must stress as being important) Make sure that your processor's ground pins are all connected very closely together (i.e. the tracks between them are as short as possible) and that very importantly your programmer ground is also connected to the same ground pins very closely.- At high programming speeds a thin or long unbalanced (different length) ground track to the processor can cause a problem with some devices.

  6. Whatever you are using to supply power to the processor must have a supply with a similar voltage as the ST-LINK (mine is 3V) - (although I have found that if the processor supply is 3.3V programming seems to still work most of the time.) (Remember the original ST-Link does not supply power only reads the power level.)

  7. A dodgy programming setup can accidentally set the protection to LEVEL 2 bricking your device - so if you have been trying and not getting any further, it might be time to replace your IC.

  8. Prior to changing / erasing a device that had been programmed to LEVEL 1, you might need to first enable the PCROP_RDP option byte. - Once enabled, you should be able to change from LEVEL 1 to LEVEL 0 that will automatically erase the device.

  9. Some people have suggested holding the device in reset until just after pressing the erase button to enable erasing it.

I hope these suggestions help...

1
Chris Mueller On

I just wanted to chime in for the next person who comes along with this problem. @Jarek's solution is what worked for me. In my case, I have two St-Link V2 USB dongles, and both have a Geehly chip instead of an ST chip inside. I updated the firmware on both using ST's Firmware upgrade utility and tried every possible combination of settings in STM32CubeProgrammer but was unable to get anything to happen upon clicking 'Connect'. This includes not getting any error messages. The serial number for both of my dongles was a single letter ("A" and "D"). I never managed to get them working with STM32CubeProgrammer, but was able to use them with the deprecated STM32 ST-LINK Utility as well as using them as a debugger with IAR.

It seems like this is a bug with STM32CubeProgramer which will hopefully be resolved in the future.

0
aravind.h615 On

I had same problem with STM32CubeProgrammer . But , it worked flawlessly in STM32 ST-LINK Utility enter image description here

1
crist On

The solution for me (my own custom board) was to enable "Shared" option.

Symply after enabling the feature the serial number appears instead of "G".

Hope it's your same problem.

0
sm_thamizha On

I had no luck in programming while using Type-C cable to power the board. I got it to work when I connected the 3.3V pin from the ST-Link V2 to a 3V3 pin in the board. Don't power the board using Type-C while using the 3V3 pin.

Like you, I couldn't find a proper solution online. I created a somewhat detailed notes, but couldn't make a post on ST Community, Seeed Studio forum or here. Since I'm a new user, I don't have much reputation to embed links or add multiple images. It also finds it as a spam. Hoping I get enough upvotes to make a simple post for future users.