cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner`s ask for help to flash the STM32

Vilius
Associate II

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...

41 REPLIES 41
MM..1
Chief II

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.

Cheers, voltage fixed by using the USB port connected to a power source - seeing 3.29V now. Also did a continuity check on all the wires soldered to the ST-LINK V3-MINIE, not pretty but those are good too. Still the 'no target' error however.

One clue? I connected the STM32F103C8T6 to an FTDI (USB to Serial) converter and was able to get the STM32CubeProgrammer to see the chip's memory using UART on the MCU's COM port.

In summary:

  • Power's good now
  • The CubeProgrammer is able to connect using an FTDI on UART (see below)
  • Also able to upload and run code using the Arduino IDE
  • The chip appears to have the ST logo, i.e. not a blue pill?
  • The ST-LINK V3 still displays the same error unfortunately

IMG_5586.JPG IMG_5588.jpg IMG_5584.JPG

EdoJidai_0-1698903815389.png

 

 

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

   

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".

On your image F030K6 require 3V3 on pins 1,5,17 and GND on pins 16 and 32 , i dont see it on wires...

liaifat85
Senior II

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

Problem solved. Uninstalled all drivers (and IDE's), reinstalled and now able to connect through the STM32CubeProgrammer! Overwhelming onboarding feeling starting to fade...

Ok, just another update, I finally flashed that other little STM verifying that my stlink is ok, however, lets get back to the BGA one.

I reinstalled all drivers and STMCubeProgrammer software on m PC.
I checked my wiring and my breakout BGA PCB once again...
I decided to put even more decoupling caps on my power pins and solder all the SWD wires directly to the MCU. By doing this I hope to absolutely burry a slightest chance of hardware, noise, wire length and similar problems. I am using a premium micro usb cable connected to a USB3.0 port on my PC. Well, this time my setup is unquestionable (I hope). I am aware that NRST pin could be kept by the stlink after flashing. Let's not focus on that now. If I succeed in this step, I will gladly disconnect my USB cable from Stlink after each flashing and eventually make the NRST pin on some button or etc...

I am still getting the exact same error ,,No target found" if I am forcing to flash over and over again. However, If I disconnect the power from my 3.3V LDO, reconnect it again, the very first connection is made for around 3-5 seconds (connection settings such as speed or reset mode does not even matter, I can make it connect under different configurations...). After that, I get ,,Unable to get Core ID" error (same one I wrote earlier about). If I try to connect again without disconnecting power again, Its the same ,,No target found" error. I feel like my BGA PCB has nothing to do know, I am clearly missing some part of the flashing process. Any ideas?

I write 1.11 you about error in your schematics. Unconnected VDD USB pin , regulator control... You correct this???

Yes, VDDUSB is now at 3.3V also, but my problem is still the same as I described in the last post