Skip to main content
Vilius
Associate III
July 28, 2023
Question

Beginner`s ask for help to flash the STM32

  • July 28, 2023
  • 8 replies
  • 26207 views

Hi,

I am an absolute beginner in STM32 ecosystem. This is my first time programing an STM32. My MCU is STM32F756VGH6 in TFBGA100 package. I wrote a simple led blink program and encountered a problem while trying to flash the MCU (got some kind of error while trying to flash directly from the STM32CubeIDE). After consulting with my friend, I tried only building the project in the STM32CubeIDE and using STM32CubeProgrammer to flash the MCU. However, there was no luck yet... While trying to flash the .elf file from the project`s debug folder I was constantly getting error ,,Problem ocurred while trying to connect". I guess its worth mentioning that I was also constantly getting message that I should update my stlink`s firmware, but that process was not successful either.

For the record, my stlink is not an original one (picture down below), but it worked for my friend, and also a few years ago I programmed an STM8 with it, so I guess this should not cause any problems - the programmer has to be working.

I made sure that my wiring is correct, I am getting the 3.3V where it has to be... I made a custom PCB just for the TFBGA100 to 2.54 header adapter and already put solid amount of decoupling smd capacitors on the other side of the board, I believe it has nothing to do with hardware also...

I tried to connect the stlink`s RST pin with NRST pin on the MCU, also tried to connect a reset button with a pull-down resistor and capacitor to it, I have not noticed any difference...

What else could be wrong? Any hints or observations? Thank you in advance

Sorry for the extensive post, just wanted to get in front of some of the obvious and regular answers...

This topic has been closed for replies.

8 replies

TDK
July 28, 2023

There have been a lot of posts lately from people with counterfeit programmers with this error. Seems STM32CubeIDE may have been updated to reject them.

Programmers (at least STLINK-V3MINIE) and nucleo boards are cheap, recommend getting one of those. I doubt ST is making any profit off of them.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Johi
Senior II
July 28, 2023

I did some experiments with an old blue-pill including an old programmer identical to the on of the OP from similar origin. (If I am not mistaken, the black V2 ST-Link programmer used to work with STM32CubeIDE properly)

My findings point in the same direction as indicated by @TDK:

  • STM32CubeIDE is refusing to connect to the blue pill but request a firmware upgrade.
  • Firmware upgrade process gives strange feedback messages (upgrade succeeded and failed together ?):

Johi_0-1690563498507.png

Trying to reconnect -> same cycle restarts

Using STLINK V3-Set, programming and debugging works as it should.

Johi_1-1690564972655.png

 

Vilius
ViliusAuthor
Associate III
July 28, 2023

So the conclusion is that my third-party programmer just wont work, I have to buy V3 one and thats simply a given?

Amel NASRI
ST Technical Moderator
August 10, 2023
To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Vilius
ViliusAuthor
Associate III
October 30, 2023

Ok, a little update...

I got an original stlink V3 with the latest software. Also wrote a simple LED blik program that does compile, however, I encountered problems while flashing again. 


No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication

Thats what the STM32CubeProgrammer tells me when I press ,,Connect" button in the STM32CubeProgrammer... Some other details:

Stlink NRST -> NRST stm32

Stlink DIO -> PA13 stm32

Stlink CLK -> PA14 stm32

Stlink GND -> GND stm32

Stlink VCC is not connected anywhere


BOOT0 is pulled up via 4.7k to VCC
I am getting the 3.3V on the power pins (I use a 3.3V regulator powered by 5V usb supply), the voltages are all ok.
It could look like a simple mistake for you, but I dont really have any experience with STM32, any ideas how to fix it? If you need any additional information, please, let me know...

TDK
October 30, 2023

Should work. Double check your pin connections. Shouldn't need to, but you can click "connect under reset" to prevent bad code from re-assigning the SWD pins.

How confident are you that the BGA is properly soldered?

Are VCAP decoupled to ground with a 2.2 uF cap? Are VCAP voltages ~1.2V?

Are VDDA and all other VDD pins powered? VSS/VSSA all connected? Other schematic errors?

Typically BOOT0 is pull down to GND, not to 3V3, so that user code is run on startup. Not the problem here though.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Vilius
ViliusAuthor
Associate III
October 30, 2023

Yes, I spent many hours reading the datasheet recommendations, the board I designed is tested well (all the caps are on the other side, they are serving their duty :) ) I do connect all the vdd and vss pins to either +V and GND, If I made a mistake between vdd and vss, I would not see 3.3V on the multimeter, the mcu would pull the vdd way lower than 3.3V... Thats not the case. As far as BGA soldering goes, the chip was factor-balled, I soldered only once without any adjustments, It is soldered perfectly... In other words, I am more than confident about my wiring and hardware...

Where can I find that ,,connect under reset" button in the stm32cubeprogrammer? I saw this recommendation in other similar threads but could not really find that one in the programmer... As far as I understand from the datasheet, the BOOT0 must be pulled high during the programming, or am I wrong?

Pavel A.
October 31, 2023

These files are 'artifacts' of the st-link. The error description there comes from the st-link. "FAIL" obviously means no good. Check your wires, power...  Is some program running on the stm32 that can interfere with the debugger? While the connection is alive try to stop the MCU and erase it. Will the debugger connection stay then?

Vilius
ViliusAuthor
Associate III
October 31, 2023

Ok, after few hours I lost the connection I wrote about in the last post. Now I get exact same error just like yesterday when I try to connect my MCU to the programmer...My wiring is in the picture below. I use a quality micro USB cable connected to USB 3.0 port on my computer. I dont see any other hardware issues at all.

Can anyone explain me how can I do the debug authentication the programmer is constantly forcing me to?

Pavel A.
October 31, 2023

The "authentication" message is misleading, not relevant here. Check the flying wires from ST-LINK to the target.

 

 

MM..1
Chief III
October 31, 2023

As absolute beginner you choice most advanced STLINKV3 and high advanced BGA . As i write before, check your STLINK with other MCU or other OK Stlink with your MCU...

My tip download and install older ST Link utility and try connect in . Too next tip, your voltage converter to 3V3 is designed for how current limit?

Vilius
ViliusAuthor
Associate III
October 31, 2023

My converter is capable of 500 mA.

Well, I you have been following the thread from the beginning, you know, that I had problems with an after market STLINK, so If I am about to spend 50+ euros, I want the best option for the day. Why would I get STLINK V2, If I can get V3 for future compatibility (this STM project wont be the only one...) SWD protocol is independent of the stlink version. It is not criticism, but even as an absolute beginner I know, that complexity of the programmer (an original and working one in this case) has nothing to do with my problem.About the BGA... I dont see any problem again. I am not running GHz signals on a HDI mixed signal board with RF etc. We are speaking about frequencies way below 10 Mhz. All the connections are transparent so to speak, they do not introduce any hardware related problems. I spent so much time doing this breakout board, I put all the capacitors according to all the PCB rules. I verified I am getting the right voltages, my VCAPS are at 1.2V. My soldering is flawless this time... Those 3 letters of BGA act as an immediate red flag to you without considering the circumstances I am describing yet again...As I said, dont take it as criticism, its me who is searching for help and I am grateful to you all for your help. The only thing I am trying to say is that I am completely new to STM32, but not a total beginner in electronics, I have worked with PIC mcu s in the past and I know, that my hardware is all good this time. Its either a software problem, or a substantive problem of hardware (making wrong connections and believing those are right, but not missing a untrustworthy ones...) Having said that, I am still grateful to you all, I will try the ST Link utility tomorrow.

AScha.3
Super User
October 31, 2023

ok, so you are experienced professional . i am not...just playing around with electronics 40 y.

but on your pic with your almost empty breakout board - where are all decoupling caps, the crystal oscillator etc ... bottom side?

AScha3_0-1698787557724.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
MM..1
Chief III
November 1, 2023

And @Vilius for your info as beginner. Stlink is part of all Nucleo boards (too other) and on most is simple cut it and use as programmer. 

And for compare buy this NUCLEO-F756ZG - STM32 Nucleo-144 development board with STM32F756ZG MCU, supports Arduino, ST Zio and morpho connectivity - STMicroelectronics is more flexible choice as alone prog.

Vilius
ViliusAuthor
Associate III
November 5, 2023

Ok, update again.

I took a spare STM32F030K6T6 in LQFP32 package. I soldered it straight to breakout board without any capacitors etc. I connected the jumpers for SWD programming. I guess this time it is as simple as it gets... I still get the same ,,No device found" error. I choose the lowest 5 Khz speed... Interesting, that logs show voltage of 0V, (VDD of STM32 connected to the VCC pin of stlink) And I also get same error text file as soon as I connect my stlink to the PC. I am clearly missing out some settings. Any ideas?

Capture1.JPG

20231105_190604.jpg

20231105_190548.jpg

AScha.3
Super User
November 5, 2023

at this target voltage

AScha3_0-1699206733766.png

st-link dont work - it assumes, no target can work at 0V .

so connect st-link vdd (input) to target vdd (3v3).

AScha3_1-1699207460374.pngAScha3_2-1699207479275.png

you have to connect 3v3 power to your target !!!! the st-link only checking voltage - NO power output !!!

"If you feel a post has answered your question, please click ""Accept as Solution""."
Visitor II
November 5, 2023

since it's a custom-made PCB, I think you need to test the PCB too.