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
Vilius
Associate II

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?

The board has double sided sticky tape under it, its just an optical illusion, it has no electrical contact with the breadboard at all (I taped it just for the convenience.) Somehow I dont believe hardware has anything to do with flashing... I am programming the chip at 1 Mhz speed just to toggle GPIO once every second, how could that be related to PCB design limitations? I really spent so many hours on that board, put all the decoupling etc... The only thing that bothers me is the NRST and BOOT configuration just like you and TDK have mentioned, I will try that tomorrow. Bellow is my schematic and 3D view in altium, how the other side of the PCB under the chip looks. Thank you all in advance.

However, the programmer tells my to check the ,,Debug Authentication", I cant really find any clear tutorials on how should I do it, or enable it, or authenticate, or something else. Can anyone briefly explain me should I do, and what exactly if I should to authenticate the debugger, or at least something like that (I have no idea, just seems like strange error from the programmer...) Thank you all again

And VCAP voltages are 1.2V?

BOOT0 does not need to be in any particular state during SWD programming. It needs to be high to boot into the bootloader, but that's a different thing.

The connect under reset setting is in the Mode settings, but it's unlikely to help anything in this case.

TDK_0-1698700333693.png

 

If you feel a post has answered your question, please click "Accept as Solution".

@Vilius wrote:

... As far as I understand from the datasheet, the BOOT0 must be pulled high during the programming, or am I wrong?


Yes and no, programming STM can be direct (SWD/JTAG) and indirect over bootloader interfaces (UART,USB,...) here BOOT0 require 1. 

 

IMG_5562.JPGAlso new to the STM32 world and getting a similar "No STM32 target found!" error in the STM32CubeProgrammer. My concern is that I haven't wired things up correctly to the STM32F103C6T6 from the STLINK-V3NMINIE. Am I correct in assuming that it's as straightforward as SWIO > SWIO, SWCLK > SWCLK and GND > GND?

yes, but also connnect target 3v3 to V3NMINIE (pin 10 ?) , it checks here, whether target has power.

and connect mode : software reset ; (or you have to connect reset line also, for hardware reset)

If you feel a post has answered your question, please click "Accept as Solution".
Vilius
Associate II

Ok, a little progress again,

Both VCAP`s are at 1.2V, I pulled BOOT0 low, and NRST (both on the mcu ant stlink connected together) pulled high via 750 Ohm resistor. I connected the VCC terminal of the stlink to my main vdd line provided from a 5 to 3.3V linear regulator. Besides that, nothing was changed.

Now I can get stlink to connect mcu and the pc, but after 5-10 seconds the connection is lost due to ,,Unable to get core ID" error. Any ideas at this point?

Also not sure if it is related, but when I connect my stlink to pc, the pc shows me it as a usb device containing 2 auto-generated text files in it (picture down bellow.) Should it be like that?

Pavel A.
Evangelist III

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?

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?