2025-03-08 11:53 AM
I created a custom STM32 board for a motor controller, but I am having trouble even programming it using the STLink V2. I am using the STM32C071KBT6N MCU that I purchased from Mouser. I soldered it onto my board using drag soldering. I soldered other components near it with hot air.
I have tried to power the board through an external 3.3V power supply and through the STLink itself.
This STM32 model has the same pin for PA14-BOOT0 and SWCLK. But I just directly connected the pin to the header for STLink V2.
I also do not have an external crystal oscillator to connect because I wanted to keep it simple and just use the internal clock.
I get this error in STM32 Cube Programmer.
And these are the settings I am currently using.
I have tried different combinations of settings and have held the reset button down, but I still end up with the same error.
I am not sure if something is wrong with my design, the chip that I received was bad, or I somehow destroyed the chip while soldering.
I hope someone can help me. Thanks!
2025-03-08 1:36 PM
Design looks correct. Chip is unlikely to be damaged by soldering--it is quite robust.
Most likely thing is a bad solder joint or a mistake in wire connections.
It's so much easier to put a standard programming header on the board and use that. Saves time and takes the guesswork out of stuff like this.
Measure voltage on the board. On the actual STM32 pins if possible-to ensure it is powered. Not sure how power is being supplied here. BOOT0 pin state doesn't matter as far as establishing a SWD connection. As I recall, the chip boots up into the bootloader when empty regardless, although it doesn't matter here with no program loaded.
Ensure pin 5 has a good connection. I see parts of the gold pad of the board--solder definitely didn't wet the entire pad.
2025-03-08 2:09 PM
Thanks for replying!
I have measured the voltage across the pins of the MCU and it shows up as 3.3V (Either from the external voltage source or the STLink V2 directly).
For the pin 5 you were mentioning, I think a bit of the green solder mask came off.
I will first try making the SWD wires shorter to see if that helps (I saw somewhere that it helped). Then I will try desoldering the chip, cleaning the board with alcohol and then resoldering it back onto the board to see if that helps.
2025-03-12 11:17 AM
I tried a new board, resoldered everything, and made the wires smaller, but it still does not seem to work and gives me the same error? I do not know what is wrong, and I do not know what to fix in the next iteration of my pcb.
2025-03-12 2:47 PM - edited 2025-03-12 2:48 PM
Pin 7 should be SWDIO. Pin 9 should be SWCLK.
On your first picture, pins 7+9 look unconnected while pins 11+13 look connected.
Same on second picture
That's probably the mistake. If not:
What are the connections to C12 doing? Are those on the same net as 3V3. And if so, why put a capacitor across them?
Pins 1+2 should be connected to 3V3 on the target board.
2025-03-12 3:28 PM
In both the pictures, I believe that the pins connected correctly. In the datasheet, the notch on the stlink is on the left and pin 1 is defined as the top left. So in the picture, the notch is on the right, so the pins would be the other way.
The C12 is a 47uF capacitor that is supposed to be the output of a buck converter on the board and it is connected between GND and 3.3V. I messed up on the buck converter so I just soldered the microcontroller stuff to test it and provide 3.3V to the board through the capacitor's pads.
2025-03-12 4:43 PM
> In the datasheet, the notch on the stlink is on the left and pin 1 is defined as the top left. So in the picture, the notch is on the right, so the pins would be the other way.
You're right, my bad.
Shrug.
Have had no problem connecting to STM32C0's here.
2025-03-12 4:46 PM
@Rishthegreat wrote:In both the pictures, I believe that the pins connected correctly.
Yes, I think so: