cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G071KBU6 unable to program with STLink V3-minie

DylanChurch
Visitor

While designing Electronic speed controllers for a 6s battery, an stm32 was decided to use as the MCU. 

 

After receiving our first PCBs, we were unable to successfully program them with the stlinkv3 minie. Attached is an image of the schematic of where the STM lies on the board as well as the attached components. When the boards first came in the stm32 was able to be flashed with a program, but after the first flash they could not be connected to any more. This is with using an external power supply as the stlink v3 didn't seem to provide power as the prg tool was unable to detect the chip.

 

After continued testing (and changing out the mcu) the issue persisted although with a slight deviation, it would allow us to program it once or twice but when we clear the flash, it would lose connection and throw an error of dev_target_held_under_reset. In case it is relevant, the only connection type that can even read the flash of the chip is hot plug but that is unable to change the data as far as I am aware.

 

Trying to alleviate this issue, the reset decoupling capacitor was removed in case there was something causing a short, as well as a blank pcb being used with just the microcontroller and capacitors included. Still no luck. In case it was the program that was being applied, the program was changed to a simple blink program, however, even this will not work. We have 2 different layout/schematics for two different tasks that both use the same microcontroller and neither of them are able to program. Either the program tool says no stm32 found, or it says that it is held under reset. I have searched many forums and have not found any solutions that work, including using a 10kOhm resistor from 3.3v to the reset pin in case the internal pullup was not providing enough power to the pin. None of these solutions work. The original software (bootloader and firmware of AM32) works on a nucleo test board with the same steps used to program the custom pcb and the same microcontroller (although different package, they are both 128k flash g071).

This is very frustrating as we have not been able to even test the hardware that we have designed for the past 2 months as we have been stuck trying to program the boards for so long. Any help or solutions that could be provided would be absolutely lovely. The layout of the microcontroller for one of the PCBs is also provided with the reset path highlighted. (Continuity of all of the paths has already been tested and there are no issues in that respect.

DylanChurch_0-1770059931616.png

DylanChurch_1-1770060405128.png

 

 

10 REPLIES 10
TDK
Super User

Is there a common ground between the board, the programmer, and the power supply? Show a picture of this.

Does the programmer report the correct target board voltage? Show a full screenshot when you try to connect.

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

Yes, All three grounds are connected, im currently out of the lab and using an arduino as a power supply, not the most elegant solution, but it is what i used when programming the nucleo board. If you think its because of the arduino... I can go to the lab in about 45 minutes and send a screenshot from there, but the voltage on 3.3v is 3.3v, and the arduino can deliver more current than the mcu should take.

Also, the black around the microcontroller is from the flux that we used, it was old and discolored the soldermask.

 

DylanChurch_1-1770061488268.png

 

DylanChurch_2-1770061520288.png

 

TDK
Super User

This is likely a hardware issue. If NRST is stuck low, the chip may not have sufficient power. There's nothing wrong with this setup in theory.

Is the chip oriented correctly? That picture isn't close enough to tell. Pin 1 is bottom left when text reads from left to right. If you can, post a clear, large, in-focus of the chip itself and surrounding solder joints.

Turn your soldering iron down. The flux should not be discoloring that much, even if it's old.

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

The  pcb software add3d an alignment dot to the silkscreen, that dot is lined up with the dot on the chip, so, im sure it is orientated correctly, also, since it was able to program twice before stopping i dont believe this is the issue.1000005458.jpg

1000005456.jpg

mfgkw
Senior III

It looks a bit like BBQ, sorry.

Maybe it got damaged while soldering?

While that is possible, the same problem has happened with multiple chips. The ic was installed with hot air gun set to 400f, this issue has persisted across 4 different stm32s that are across different pcbs, though ive used 2 on this pcb.

Also, if it was damaged while installing, why did it work a few times and then just stop working? 

TDK
Super User

Orientation looks correct.

Capacitor solder joints look good.

Presumably the STM32 solder joints are okay too. Looks better than I was expecting from the first picture.

400 F is a good temp for leaded solder. The capacitor joints look good so the temperature is probably good even if the "400" setting is off.

 

There's not much that needs to be correct to connect to the chip. One of those isn't happening:

  • Chip isn't damaged.
  • GND connection.
  • VCC connection.
  • SWDIO connection.
  • SWCLK connection.
  • (NRST is optional, not needed if SWD pins are not reconfigured).

 

If it was able to be programmed before, and now it isn't, something happened. Try to figure out what that was. What were you doing with the chip? Does it draw an unreasonable amount of power or get unreasonably hot? The chip doesn't spontaneously become unresponsive on its own.

 

The schematic is good, this isn't a design issue.

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

It doesnt draw much power or get hot, the only thing that changed was i turned off the power and went to get lunch. With the programmer connected it draws around 70ma without the programmer connected the bench supply shows .02 A.

 

As far as the lunch part, I had the same thing happen on other boards without taking a break. Nothing getting hot, nothing changing, often the issue starts when I try mass flash erase.